11 #ifndef ASIO_ASSOCIATED_EXECUTOR_HPP 12 #define ASIO_ASSOCIATED_EXECUTOR_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 18 #include "asio/detail/config.hpp" 19 #include "asio/detail/type_traits.hpp" 20 #include "asio/execution/executor.hpp" 21 #include "asio/is_executor.hpp" 22 #include "asio/system_executor.hpp" 24 #include "asio/detail/push_options.hpp" 29 template <
typename T,
typename E,
typename =
void>
32 typedef void asio_associated_executor_is_unspecialised;
36 static type
get(
const T&,
const E& e = E()) ASIO_NOEXCEPT
42 template <
typename T,
typename E>
44 typename
void_type<typename T::executor_type>::type>
46 typedef typename T::executor_type type;
48 static type
get(
const T& t,
const E& = E()) ASIO_NOEXCEPT
50 return t.get_executor();
75 template <
typename T,
typename Executor = system_executor>
77 #if !defined(GENERATING_DOCUMENTATION)
79 #endif // !defined(GENERATING_DOCUMENTATION) 81 #if defined(GENERATING_DOCUMENTATION) 82 typedef see_below type;
88 static type
get(
const T& t,
89 const Executor& ex = Executor()) ASIO_NOEXCEPT;
90 #endif // defined(GENERATING_DOCUMENTATION) 98 inline typename associated_executor<T>::type
99 get_associated_executor(
const T& t) ASIO_NOEXCEPT
108 template <
typename T,
typename Executor>
109 inline typename associated_executor<T, Executor>::type
110 get_associated_executor(
const T& t,
const Executor& ex,
113 >::type* = 0) ASIO_NOEXCEPT
123 template <
typename T,
typename ExecutionContext>
125 typename ExecutionContext::executor_type>::type
126 get_associated_executor(
const T& t, ExecutionContext& ctx,
127 typename enable_if<is_convertible<ExecutionContext&,
131 typename ExecutionContext::executor_type>::get(t, ctx.get_executor());
134 #if defined(ASIO_HAS_ALIAS_TEMPLATES) 136 template <
typename T,
typename Executor = system_executor>
137 using associated_executor_t =
typename associated_executor<T, Executor>::type;
139 #endif // defined(ASIO_HAS_ALIAS_TEMPLATES) 143 template <
typename T,
typename E,
typename =
void>
148 template <
typename T,
typename E>
153 E>::asio_associated_executor_is_unspecialised,
158 typedef void asio_associated_executor_is_unspecialised;
164 #include "asio/detail/pop_options.hpp" 166 #endif // ASIO_ASSOCIATED_EXECUTOR_HPP Definition: type_traits.hpp:135
Definition: associated_executor.hpp:30
A context for function object execution.
Definition: execution_context.hpp:105
Definition: type_traits.hpp:97
The is_executor trait detects whether a type T meets the Executor type requirements.
Definition: is_executor.hpp:33
Traits type used to obtain the executor associated with an object.
Definition: associated_executor.hpp:76
Definition: associated_executor.hpp:144
Definition: any_io_executor.hpp:28
The is_executor trait detects whether a type T satisfies the execution::executor concept.
Definition: executor.hpp:109