Files

154 lines
4.1 KiB
C++

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