11 #ifndef ASIO_REQUIRE_HPP 12 #define ASIO_REQUIRE_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/is_applicable_property.hpp" 21 #include "asio/traits/require_member.hpp" 22 #include "asio/traits/require_free.hpp" 23 #include "asio/traits/static_require.hpp" 25 #include "asio/detail/push_options.hpp" 27 #if defined(GENERATING_DOCUMENTATION) 65 inline constexpr unspecified require = unspecified;
73 template <
typename T,
typename... Properties>
75 integral_constant<bool, automatically_determined>
85 template <
typename T,
typename... Properties>
86 struct is_nothrow_require :
87 integral_constant<bool, automatically_determined>
97 template <
typename T,
typename... Properties>
101 typedef automatically_determined type;
106 #else // defined(GENERATING_DOCUMENTATION) 130 template <
typename T,
typename Properties,
typename =
void>
133 ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed);
134 ASIO_STATIC_CONSTEXPR(
bool, is_noexcept =
false);
135 typedef void result_type;
138 template <
typename T,
typename Property>
143 typename decay<T>::type,
144 typename decay<Property>::type
147 decay<Property>::type::is_requirable
153 ASIO_STATIC_CONSTEXPR(overload_type, overload = identity);
154 ASIO_STATIC_CONSTEXPR(
bool, is_noexcept =
true);
156 #if defined(ASIO_HAS_MOVE) 157 typedef ASIO_MOVE_ARG(T) result_type;
158 #else // defined(ASIO_HAS_MOVE) 159 typedef ASIO_MOVE_ARG(
typename decay<T>::type) result_type;
160 #endif // defined(ASIO_HAS_MOVE) 163 template <
typename T,
typename Property>
168 typename decay<T>::type,
169 typename decay<Property>::type
172 decay<Property>::type::is_requirable
181 ASIO_STATIC_CONSTEXPR(overload_type, overload = call_member);
184 template <
typename T,
typename Property>
189 typename decay<T>::type,
190 typename decay<Property>::type
193 decay<Property>::type::is_requirable
204 ASIO_STATIC_CONSTEXPR(overload_type, overload = call_free);
207 template <
typename T,
typename P0,
typename P1>
213 typename call_traits<T, void(P0)>::result_type,
215 >::overload != ill_formed
218 ASIO_STATIC_CONSTEXPR(overload_type, overload = two_props);
220 ASIO_STATIC_CONSTEXPR(
bool, is_noexcept =
230 typedef typename decay<
232 typename call_traits<T, void(P0)>::result_type,
238 template <
typename T,
typename P0,
typename P1,
typename ASIO_ELLIPSIS PN>
244 typename call_traits<T, void(P0)>::result_type,
245 void(P1, PN ASIO_ELLIPSIS)
246 >::overload != ill_formed
249 ASIO_STATIC_CONSTEXPR(overload_type, overload = n_props);
251 ASIO_STATIC_CONSTEXPR(
bool, is_noexcept =
257 void(P1, PN ASIO_ELLIPSIS)
261 typedef typename decay<
263 typename call_traits<T, void(P0)>::result_type,
264 void(P1, PN ASIO_ELLIPSIS)
271 template <
typename T,
typename Property>
272 ASIO_NODISCARD ASIO_CONSTEXPR
typename enable_if<
274 typename call_traits<T, void(Property)>::result_type
278 ASIO_MOVE_ARG(Property))
const 282 return ASIO_MOVE_CAST(T)(t);
285 template <
typename T,
typename Property>
286 ASIO_NODISCARD ASIO_CONSTEXPR
typename enable_if<
287 call_traits<T, void(Property)>::overload == call_member,
288 typename call_traits<T, void(Property)>::result_type
292 ASIO_MOVE_ARG(Property) p)
const 296 return ASIO_MOVE_CAST(T)(t).require(
297 ASIO_MOVE_CAST(Property)(p));
300 template <
typename T,
typename Property>
301 ASIO_NODISCARD ASIO_CONSTEXPR
typename enable_if<
302 call_traits<T, void(Property)>::overload == call_free,
303 typename call_traits<T, void(Property)>::result_type
307 ASIO_MOVE_ARG(Property) p)
const 312 ASIO_MOVE_CAST(T)(t),
313 ASIO_MOVE_CAST(Property)(p));
316 template <
typename T,
typename P0,
typename P1>
317 ASIO_NODISCARD ASIO_CONSTEXPR
typename enable_if<
319 typename call_traits<T, void(P0, P1)>::result_type
323 ASIO_MOVE_ARG(P0) p0,
324 ASIO_MOVE_ARG(P1) p1)
const 330 ASIO_MOVE_CAST(T)(t),
331 ASIO_MOVE_CAST(P0)(p0)),
332 ASIO_MOVE_CAST(P1)(p1));
335 template <
typename T,
typename P0,
typename P1,
336 typename ASIO_ELLIPSIS PN>
337 ASIO_NODISCARD ASIO_CONSTEXPR
typename enable_if<
339 typename call_traits<T, void(P0, P1, PN ASIO_ELLIPSIS)>::result_type
343 ASIO_MOVE_ARG(P0) p0,
344 ASIO_MOVE_ARG(P1) p1,
345 ASIO_MOVE_ARG(PN) ASIO_ELLIPSIS pn)
const 347 call_traits<T,
void(P0, P1, PN ASIO_ELLIPSIS)>::is_noexcept))
351 ASIO_MOVE_CAST(T)(t),
352 ASIO_MOVE_CAST(P0)(p0)),
353 ASIO_MOVE_CAST(P1)(p1),
354 ASIO_MOVE_CAST(PN)(pn) ASIO_ELLIPSIS);
358 template <
typename T = impl>
361 static const T instance;
364 template <
typename T>
376 #if defined(ASIO_HAS_VARIADIC_TEMPLATES) 378 template <
typename T,
typename... Properties>
380 integral_constant<bool,
381 asio_require_fn::call_traits<T, void(Properties...)>::overload
382 != asio_require_fn::ill_formed>
386 #else // defined(ASIO_HAS_VARIADIC_TEMPLATES) 388 template <
typename T,
typename P0 = void,
389 typename P1 = void,
typename P2 =
void>
391 integral_constant<bool,
392 asio_require_fn::call_traits<T, void(P0, P1, P2)>::overload
393 != asio_require_fn::ill_formed>
397 template <
typename T,
typename P0,
typename P1>
399 integral_constant<bool,
400 asio_require_fn::call_traits<T, void(P0, P1)>::overload
401 != asio_require_fn::ill_formed>
405 template <
typename T,
typename P0>
407 integral_constant<bool,
408 asio_require_fn::call_traits<T, void(P0)>::overload
409 != asio_require_fn::ill_formed>
413 template <
typename T>
419 #endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) 421 #if defined(ASIO_HAS_VARIABLE_TEMPLATES) 423 template <
typename T,
typename ASIO_ELLIPSIS Properties>
424 constexpr
bool can_require_v
427 #endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) 429 #if defined(ASIO_HAS_VARIADIC_TEMPLATES) 431 template <
typename T,
typename... Properties>
433 integral_constant<bool,
434 asio_require_fn::call_traits<T, void(Properties...)>::is_noexcept>
438 #else // defined(ASIO_HAS_VARIADIC_TEMPLATES) 440 template <
typename T,
typename P0 = void,
441 typename P1 = void,
typename P2 =
void>
443 integral_constant<bool,
444 asio_require_fn::call_traits<T, void(P0, P1, P2)>::is_noexcept>
448 template <
typename T,
typename P0,
typename P1>
450 integral_constant<bool,
451 asio_require_fn::call_traits<T, void(P0, P1)>::is_noexcept>
455 template <
typename T,
typename P0>
457 integral_constant<bool,
458 asio_require_fn::call_traits<T, void(P0)>::is_noexcept>
462 template <
typename T>
468 #endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) 470 #if defined(ASIO_HAS_VARIABLE_TEMPLATES) 472 template <
typename T,
typename ASIO_ELLIPSIS Properties>
473 constexpr
bool is_nothrow_require_v
476 #endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) 478 #if defined(ASIO_HAS_VARIADIC_TEMPLATES) 480 template <
typename T,
typename... Properties>
484 T, void(Properties...)>::result_type type;
487 #else // defined(ASIO_HAS_VARIADIC_TEMPLATES) 489 template <
typename T,
typename P0 = void,
490 typename P1 = void,
typename P2 =
void>
494 T, void(P0, P1, P2)>::result_type type;
497 template <
typename T,
typename P0,
typename P1>
501 T, void(P0, P1)>::result_type type;
504 template <
typename T,
typename P0>
508 T, void(P0)>::result_type type;
511 template <
typename T>
516 #endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) 520 #endif // defined(GENERATING_DOCUMENTATION) 522 #include "asio/detail/pop_options.hpp" 524 #endif // ASIO_REQUIRE_HPP Definition: static_require.hpp:37
Definition: require.hpp:491
Definition: require.hpp:269
Definition: require.hpp:442
Definition: require.hpp:359
Definition: type_traits.hpp:97
Definition: require_member.hpp:38
Definition: require.hpp:131
Definition: require.hpp:390
Definition: require.hpp:108
Definition: is_applicable_property.hpp:46
Definition: require_free.hpp:38
Definition: any_io_executor.hpp:28