1//
2// uses_executor.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_USES_EXECUTOR_HPP
12#define BOOST_ASIO_USES_EXECUTOR_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/type_traits.hpp>
20
21#include <boost/asio/detail/push_options.hpp>
22
23namespace boost {
24namespace asio {
25
26/// A special type, similar to std::nothrow_t, used to disambiguate
27/// constructors that accept executor arguments.
28/**
29 * The executor_arg_t struct is an empty structure type used as a unique type
30 * to disambiguate constructor and function overloading. Specifically, some
31 * types have constructors with executor_arg_t as the first argument,
32 * immediately followed by an argument of a type that satisfies the Executor
33 * type requirements.
34 */
35struct executor_arg_t
36{
37 /// Constructor.
38 constexpr executor_arg_t() noexcept
39 {
40 }
41};
42
43/// A special value, similar to std::nothrow, used to disambiguate constructors
44/// that accept executor arguments.
45/**
46 * See boost::asio::executor_arg_t and boost::asio::uses_executor
47 * for more information.
48 */
49constexpr executor_arg_t executor_arg;
50
51/// The uses_executor trait detects whether a type T has an associated executor
52/// that is convertible from type Executor.
53/**
54 * Meets the BinaryTypeTrait requirements. The Asio library provides a
55 * definition that is derived from false_type. A program may specialize this
56 * template to derive from true_type for a user-defined type T that can be
57 * constructed with an executor, where the first argument of a constructor has
58 * type executor_arg_t and the second argument is convertible from type
59 * Executor.
60 */
61template <typename T, typename Executor>
62struct uses_executor : false_type {};
63
64} // namespace asio
65} // namespace boost
66
67#include <boost/asio/detail/pop_options.hpp>
68
69#endif // BOOST_ASIO_USES_EXECUTOR_HPP
70

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