Chris@16: // Chris@16: // placeholders.hpp Chris@16: // ~~~~~~~~~~~~~~~~ Chris@16: // Chris@101: // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. (See accompanying Chris@16: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: Chris@16: #ifndef BOOST_ASIO_PLACEHOLDERS_HPP Chris@16: #define BOOST_ASIO_PLACEHOLDERS_HPP Chris@16: Chris@16: #if defined(_MSC_VER) && (_MSC_VER >= 1200) Chris@16: # pragma once Chris@16: #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) Chris@16: Chris@16: #include Chris@16: Chris@16: #if defined(BOOST_ASIO_HAS_BOOST_BIND) Chris@16: # include Chris@16: #endif // defined(BOOST_ASIO_HAS_BOOST_BIND) Chris@16: Chris@16: #include Chris@16: Chris@16: namespace boost { Chris@16: namespace asio { Chris@16: namespace placeholders { Chris@16: Chris@16: #if defined(GENERATING_DOCUMENTATION) Chris@16: Chris@16: /// An argument placeholder, for use with boost::bind(), that corresponds to Chris@16: /// the error argument of a handler for any of the asynchronous functions. Chris@16: unspecified error; Chris@16: Chris@16: /// An argument placeholder, for use with boost::bind(), that corresponds to Chris@16: /// the bytes_transferred argument of a handler for asynchronous functions such Chris@16: /// as boost::asio::basic_stream_socket::async_write_some or Chris@16: /// boost::asio::async_write. Chris@16: unspecified bytes_transferred; Chris@16: Chris@16: /// An argument placeholder, for use with boost::bind(), that corresponds to Chris@16: /// the iterator argument of a handler for asynchronous functions such as Chris@16: /// boost::asio::basic_resolver::async_resolve. Chris@16: unspecified iterator; Chris@16: Chris@16: /// An argument placeholder, for use with boost::bind(), that corresponds to Chris@16: /// the signal_number argument of a handler for asynchronous functions such as Chris@16: /// boost::asio::signal_set::async_wait. Chris@16: unspecified signal_number; Chris@16: Chris@16: #elif defined(BOOST_ASIO_HAS_BOOST_BIND) Chris@16: # if defined(__BORLANDC__) || defined(__GNUC__) Chris@16: Chris@16: inline boost::arg<1> error() Chris@16: { Chris@16: return boost::arg<1>(); Chris@16: } Chris@16: Chris@16: inline boost::arg<2> bytes_transferred() Chris@16: { Chris@16: return boost::arg<2>(); Chris@16: } Chris@16: Chris@16: inline boost::arg<2> iterator() Chris@16: { Chris@16: return boost::arg<2>(); Chris@16: } Chris@16: Chris@16: inline boost::arg<2> signal_number() Chris@16: { Chris@16: return boost::arg<2>(); Chris@16: } Chris@16: Chris@16: # else Chris@16: Chris@16: namespace detail Chris@16: { Chris@16: template Chris@16: struct placeholder Chris@16: { Chris@16: static boost::arg& get() Chris@16: { Chris@16: static boost::arg result; Chris@16: return result; Chris@16: } Chris@16: }; Chris@16: } Chris@16: Chris@16: # if defined(BOOST_ASIO_MSVC) && (BOOST_ASIO_MSVC < 1400) Chris@16: Chris@16: static boost::arg<1>& error Chris@16: = boost::asio::placeholders::detail::placeholder<1>::get(); Chris@16: static boost::arg<2>& bytes_transferred Chris@16: = boost::asio::placeholders::detail::placeholder<2>::get(); Chris@16: static boost::arg<2>& iterator Chris@16: = boost::asio::placeholders::detail::placeholder<2>::get(); Chris@16: static boost::arg<2>& signal_number Chris@16: = boost::asio::placeholders::detail::placeholder<2>::get(); Chris@16: Chris@16: # else Chris@16: Chris@16: namespace Chris@16: { Chris@16: boost::arg<1>& error Chris@16: = boost::asio::placeholders::detail::placeholder<1>::get(); Chris@16: boost::arg<2>& bytes_transferred Chris@16: = boost::asio::placeholders::detail::placeholder<2>::get(); Chris@16: boost::arg<2>& iterator Chris@16: = boost::asio::placeholders::detail::placeholder<2>::get(); Chris@16: boost::arg<2>& signal_number Chris@16: = boost::asio::placeholders::detail::placeholder<2>::get(); Chris@16: } // namespace Chris@16: Chris@16: # endif Chris@16: # endif Chris@16: #endif Chris@16: Chris@16: } // namespace placeholders Chris@16: } // namespace asio Chris@16: } // namespace boost Chris@16: Chris@16: #include Chris@16: Chris@16: #endif // BOOST_ASIO_PLACEHOLDERS_HPP