1//
2// placeholders.hpp
3// ~~~~~~~~~~~~~~~~
4//
5// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6//
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)
9//
10
11#ifndef BOOST_ASIO_PLACEHOLDERS_HPP
12#define BOOST_ASIO_PLACEHOLDERS_HPP
13
14#if defined(_MSC_VER) && (_MSC_VER >= 1200)
15# pragma once
16#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17
18#include <boost/asio/detail/config.hpp>
19#include <boost/asio/detail/functional.hpp>
20
21#include <boost/asio/detail/push_options.hpp>
22
23namespace boost {
24namespace asio {
25namespace placeholders {
26
27#if defined(GENERATING_DOCUMENTATION)
28
29/// An argument placeholder, for use with std::bind() or boost::bind(), that
30/// corresponds to the error argument of a handler for any of the asynchronous
31/// functions.
32unspecified error;
33
34/// An argument placeholder, for use with std::bind() or boost::bind(), that
35/// corresponds to the bytes_transferred argument of a handler for asynchronous
36/// functions such as boost::asio::basic_stream_socket::async_write_some or
37/// boost::asio::async_write.
38unspecified bytes_transferred;
39
40/// An argument placeholder, for use with std::bind() or boost::bind(), that
41/// corresponds to the iterator argument of a handler for asynchronous functions
42/// such as boost::asio::async_connect.
43unspecified iterator;
44
45/// An argument placeholder, for use with std::bind() or boost::bind(), that
46/// corresponds to the results argument of a handler for asynchronous functions
47/// such as boost::asio::basic_resolver::async_resolve.
48unspecified results;
49
50/// An argument placeholder, for use with std::bind() or boost::bind(), that
51/// corresponds to the results argument of a handler for asynchronous functions
52/// such as boost::asio::async_connect.
53unspecified endpoint;
54
55/// An argument placeholder, for use with std::bind() or boost::bind(), that
56/// corresponds to the signal_number argument of a handler for asynchronous
57/// functions such as boost::asio::signal_set::async_wait.
58unspecified signal_number;
59
60#else
61
62static constexpr auto& error = std::placeholders::_1;
63static constexpr auto& bytes_transferred = std::placeholders::_2;
64static constexpr auto& iterator = std::placeholders::_2;
65static constexpr auto& results = std::placeholders::_2;
66static constexpr auto& endpoint = std::placeholders::_2;
67static constexpr auto& signal_number = std::placeholders::_2;
68
69#endif
70
71} // namespace placeholders
72} // namespace asio
73} // namespace boost
74
75#include <boost/asio/detail/pop_options.hpp>
76
77#endif // BOOST_ASIO_PLACEHOLDERS_HPP
78

source code of boost/libs/asio/include/boost/asio/placeholders.hpp