11 #ifndef ASIO_EXECUTION_CONTEXT2_HPP 12 #define ASIO_EXECUTION_CONTEXT2_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/execution/scheduler.hpp" 22 #include "asio/execution/sender.hpp" 23 #include "asio/is_applicable_property.hpp" 24 #include "asio/traits/query_static_constexpr_member.hpp" 25 #include "asio/traits/static_query.hpp" 27 #if defined(ASIO_HAS_STD_ANY) 29 #endif // defined(ASIO_HAS_STD_ANY) 31 #include "asio/detail/push_options.hpp" 35 #if defined(GENERATING_DOCUMENTATION) 45 static constexpr
bool is_applicable_property_v =
46 is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
49 static constexpr
bool is_requirable =
false;
52 static constexpr
bool is_preferable =
false;
55 typedef std::any polymorphic_query_result_type;
59 constexpr context_t context;
63 #else // defined(GENERATING_DOCUMENTATION) 71 #if defined(ASIO_HAS_VARIABLE_TEMPLATES) 73 ASIO_STATIC_CONSTEXPR(
bool,
76 #endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) 81 #if defined(ASIO_HAS_STD_ANY) 82 typedef std::any polymorphic_query_result_type;
83 #endif // defined(ASIO_HAS_STD_ANY) 89 #if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ 90 && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) 101 template <
typename E,
typename T = decltype(context_t::static_query<E>())>
102 static ASIO_CONSTEXPR
const T static_query_v
103 = context_t::static_query<E>();
104 #endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) 107 #if !defined(ASIO_HAS_CONSTEXPR) 109 #endif // !defined(ASIO_HAS_CONSTEXPR) 112 #if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ 113 && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) 114 template <
int I>
template <
typename E,
typename T>
116 #endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) 119 #if !defined(ASIO_HAS_CONSTEXPR) 128 #if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) 129 constexpr context_t context;
130 #else // defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) 131 namespace {
static const context_t& context = context_t::instance; }
136 #if !defined(ASIO_HAS_VARIABLE_TEMPLATES) 138 template <
typename T>
140 : integral_constant<bool,
141 execution::is_executor<T>::value
142 || execution::is_sender<T>::value
143 || execution::is_scheduler<T>::value>
147 #endif // !defined(ASIO_HAS_VARIABLE_TEMPLATES) 151 #if !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ 152 || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) 154 template <
typename T>
157 traits::query_static_constexpr_member<T,
158 execution::context_t>::is_valid
161 ASIO_STATIC_CONSTEXPR(
bool, is_valid =
true);
162 ASIO_STATIC_CONSTEXPR(
bool, is_noexcept =
true);
167 static ASIO_CONSTEXPR result_type value()
174 #endif // !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) 179 #endif // defined(GENERATING_DOCUMENTATION) 183 #include "asio/detail/pop_options.hpp" 185 #endif // ASIO_EXECUTION_CONTEXT2_HPP Definition: any_executor.hpp:249
The is_scheduler trait detects whether a type T satisfies the execution::scheduler concept...
Definition: scheduler.hpp:48
The is_sender trait detects whether a type T satisfies the execution::sender concept.
Definition: sender.hpp:183
Definition: static_query.hpp:42
Definition: type_traits.hpp:97
Definition: query_static_constexpr_member.hpp:42
Definition: any_executor.hpp:256
Definition: handler_work.hpp:37
Definition: is_applicable_property.hpp:46
Definition: context.hpp:69
Definition: any_io_executor.hpp:28
The is_executor trait detects whether a type T satisfies the execution::executor concept.
Definition: executor.hpp:109