1//
2// impl/any_completion_executor.ipp
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_IMPL_ANY_COMPLETION_EXECUTOR_IPP
12#define BOOST_ASIO_IMPL_ANY_COMPLETION_EXECUTOR_IPP
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
20#if !defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
21
22#include <boost/asio/any_completion_executor.hpp>
23
24#include <boost/asio/detail/push_options.hpp>
25
26namespace boost {
27namespace asio {
28
29any_completion_executor::any_completion_executor() noexcept
30 : base_type()
31{
32}
33
34any_completion_executor::any_completion_executor(nullptr_t) noexcept
35 : base_type(nullptr_t())
36{
37}
38
39any_completion_executor::any_completion_executor(
40 const any_completion_executor& e) noexcept
41 : base_type(static_cast<const base_type&>(e))
42{
43}
44
45any_completion_executor::any_completion_executor(std::nothrow_t,
46 const any_completion_executor& e) noexcept
47 : base_type(static_cast<const base_type&>(e))
48{
49}
50
51any_completion_executor::any_completion_executor(
52 any_completion_executor&& e) noexcept
53 : base_type(static_cast<base_type&&>(e))
54{
55}
56
57any_completion_executor::any_completion_executor(std::nothrow_t,
58 any_completion_executor&& e) noexcept
59 : base_type(static_cast<base_type&&>(e))
60{
61}
62
63any_completion_executor& any_completion_executor::operator=(
64 const any_completion_executor& e) noexcept
65{
66 base_type::operator=(other: static_cast<const base_type&>(e));
67 return *this;
68}
69
70any_completion_executor& any_completion_executor::operator=(
71 any_completion_executor&& e) noexcept
72{
73 base_type::operator=(other: static_cast<base_type&&>(e));
74 return *this;
75}
76
77any_completion_executor& any_completion_executor::operator=(nullptr_t)
78{
79 base_type::operator=(p: nullptr_t());
80 return *this;
81}
82
83any_completion_executor::~any_completion_executor()
84{
85}
86
87void any_completion_executor::swap(
88 any_completion_executor& other) noexcept
89{
90 static_cast<base_type&>(*this).swap(other&: static_cast<base_type&>(other));
91}
92
93template <>
94any_completion_executor any_completion_executor::prefer(
95 const execution::outstanding_work_t::tracked_t& p, int) const
96{
97 return static_cast<const base_type&>(*this).prefer(p);
98}
99
100template <>
101any_completion_executor any_completion_executor::prefer(
102 const execution::outstanding_work_t::untracked_t& p, int) const
103{
104 return static_cast<const base_type&>(*this).prefer(p);
105}
106
107template <>
108any_completion_executor any_completion_executor::prefer(
109 const execution::relationship_t::fork_t& p, int) const
110{
111 return static_cast<const base_type&>(*this).prefer(p);
112}
113
114template <>
115any_completion_executor any_completion_executor::prefer(
116 const execution::relationship_t::continuation_t& p, int) const
117{
118 return static_cast<const base_type&>(*this).prefer(p);
119}
120
121} // namespace asio
122} // namespace boost
123
124#include <boost/asio/detail/pop_options.hpp>
125
126#endif // !defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
127
128#endif // BOOST_ASIO_IMPL_ANY_COMPLETION_EXECUTOR_IPP
129

source code of boost/libs/asio/include/boost/asio/impl/any_completion_executor.ipp