5 // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef BOOST_ASIO_PLACEHOLDERS_HPP
12 #define BOOST_ASIO_PLACEHOLDERS_HPP
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18 #include <boost/asio/detail/config.hpp>
20 #if defined(BOOST_ASIO_HAS_BOOST_BIND)
21 # include <boost/bind/arg.hpp>
22 #endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
24 #include <boost/asio/detail/push_options.hpp>
28 namespace placeholders {
30 #if defined(GENERATING_DOCUMENTATION)
32 /// An argument placeholder, for use with boost::bind(), that corresponds to
33 /// the error argument of a handler for any of the asynchronous functions.
36 /// An argument placeholder, for use with boost::bind(), that corresponds to
37 /// the bytes_transferred argument of a handler for asynchronous functions such
38 /// as boost::asio::basic_stream_socket::async_write_some or
39 /// boost::asio::async_write.
40 unspecified bytes_transferred;
42 /// An argument placeholder, for use with boost::bind(), that corresponds to
43 /// the iterator argument of a handler for asynchronous functions such as
44 /// boost::asio::basic_resolver::async_resolve.
47 /// An argument placeholder, for use with boost::bind(), that corresponds to
48 /// the signal_number argument of a handler for asynchronous functions such as
49 /// boost::asio::signal_set::async_wait.
50 unspecified signal_number;
52 #elif defined(BOOST_ASIO_HAS_BOOST_BIND)
53 # if defined(__BORLANDC__) || defined(__GNUC__)
55 inline boost::arg<1> error()
57 return boost::arg<1>();
60 inline boost::arg<2> bytes_transferred()
62 return boost::arg<2>();
65 inline boost::arg<2> iterator()
67 return boost::arg<2>();
70 inline boost::arg<2> signal_number()
72 return boost::arg<2>();
82 static boost::arg<Number>& get()
84 static boost::arg<Number> result;
90 # if defined(BOOST_ASIO_MSVC) && (BOOST_ASIO_MSVC < 1400)
92 static boost::arg<1>& error
93 = boost::asio::placeholders::detail::placeholder<1>::get();
94 static boost::arg<2>& bytes_transferred
95 = boost::asio::placeholders::detail::placeholder<2>::get();
96 static boost::arg<2>& iterator
97 = boost::asio::placeholders::detail::placeholder<2>::get();
98 static boost::arg<2>& signal_number
99 = boost::asio::placeholders::detail::placeholder<2>::get();
106 = boost::asio::placeholders::detail::placeholder<1>::get();
107 boost::arg<2>& bytes_transferred
108 = boost::asio::placeholders::detail::placeholder<2>::get();
109 boost::arg<2>& iterator
110 = boost::asio::placeholders::detail::placeholder<2>::get();
111 boost::arg<2>& signal_number
112 = boost::asio::placeholders::detail::placeholder<2>::get();
119 } // namespace placeholders
123 #include <boost/asio/detail/pop_options.hpp>
125 #endif // BOOST_ASIO_PLACEHOLDERS_HPP