11 #ifndef ASIO_EXECUTION_ALLOCATOR_HPP 12 #define ASIO_EXECUTION_ALLOCATOR_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 #include "asio/detail/push_options.hpp" 31 #if defined(GENERATING_DOCUMENTATION) 37 template <
typename ProtoAllocator>
42 static constexpr
bool is_applicable_property_v =
43 is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
46 static constexpr
bool is_requirable =
true;
49 static constexpr
bool is_preferable =
true;
52 constexpr allocator_t();
58 constexpr ProtoAllocator value()
const;
64 template <
typename OtherAllocator>
65 allocator_t<OtherAllocator operator()(
const OtherAllocator& a);
73 #else // defined(GENERATING_DOCUMENTATION) 77 template <
typename ProtoAllocator>
80 #if defined(ASIO_HAS_VARIABLE_TEMPLATES) 82 ASIO_STATIC_CONSTEXPR(
bool,
85 #endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) 87 ASIO_STATIC_CONSTEXPR(
bool, is_requirable =
true);
88 ASIO_STATIC_CONSTEXPR(
bool, is_preferable =
true);
90 #if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ 91 && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) 102 template <
typename E,
typename T = decltype(allocator_t::static_query<E>())>
103 static ASIO_CONSTEXPR
const T static_query_v
104 = allocator_t::static_query<E>();
105 #endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) 108 ASIO_CONSTEXPR ProtoAllocator value()
const 116 explicit ASIO_CONSTEXPR
allocator_t(
const ProtoAllocator& a)
124 #if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ 125 && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) 126 template <
typename ProtoAllocator>
template <
typename E,
typename T>
128 #endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) 134 #if defined(ASIO_HAS_VARIABLE_TEMPLATES) 135 template <
typename T>
136 ASIO_STATIC_CONSTEXPR(
bool,
139 #endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) 141 ASIO_STATIC_CONSTEXPR(
bool, is_requirable =
true);
142 ASIO_STATIC_CONSTEXPR(
bool, is_preferable =
true);
148 #if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ 149 && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) 150 template <
typename T>
151 static ASIO_CONSTEXPR
160 template <
typename E,
typename T = decltype(allocator_t::static_query<E>())>
161 static ASIO_CONSTEXPR
const T static_query_v
162 = allocator_t::static_query<E>();
163 #endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) 166 template <
typename OtherProtoAllocator>
168 const OtherProtoAllocator& a)
const 174 #if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ 175 && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) 176 template <
typename E,
typename T>
178 #endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) 181 #if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) 183 #else // defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION) 184 template <
typename T>
190 template <
typename T>
200 #if !defined(ASIO_HAS_VARIABLE_TEMPLATES) 202 template <
typename T,
typename ProtoAllocator>
204 : integral_constant<bool,
205 execution::is_executor<T>::value
206 || execution::is_sender<T>::value
207 || execution::is_scheduler<T>::value>
211 #endif // !defined(ASIO_HAS_VARIABLE_TEMPLATES) 215 #if !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \ 216 || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES) 218 template <
typename T,
typename ProtoAllocator>
221 traits::query_static_constexpr_member<T,
222 execution::allocator_t<ProtoAllocator> >::is_valid
225 ASIO_STATIC_CONSTEXPR(
bool, is_valid =
true);
226 ASIO_STATIC_CONSTEXPR(
bool, is_noexcept =
true);
231 static ASIO_CONSTEXPR result_type value()
238 #endif // !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) 243 #endif // defined(GENERATING_DOCUMENTATION) 247 #include "asio/detail/pop_options.hpp" 249 #endif // ASIO_EXECUTION_ALLOCATOR_HPP Definition: allocator.hpp:185
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: allocator.hpp:17
Definition: static_query.hpp:42
Definition: allocator.hpp:78
Definition: type_traits.hpp:97
Definition: query_static_constexpr_member.hpp:42
Definition: handler_work.hpp:37
Definition: is_applicable_property.hpp:46
Definition: allocator.hpp:132
Definition: any_io_executor.hpp:28
The is_executor trait detects whether a type T satisfies the execution::executor concept.
Definition: executor.hpp:109