bulk_guarantee.hpp 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216
  1. //
  2. // execution/bulk_guarantee.hpp
  3. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2022 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. #ifndef ASIO_EXECUTION_BULK_GUARANTEE_HPP
  11. #define ASIO_EXECUTION_BULK_GUARANTEE_HPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. #include "asio/detail/config.hpp"
  16. #include "asio/detail/type_traits.hpp"
  17. #include "asio/execution/executor.hpp"
  18. #include "asio/execution/scheduler.hpp"
  19. #include "asio/execution/sender.hpp"
  20. #include "asio/is_applicable_property.hpp"
  21. #include "asio/query.hpp"
  22. #include "asio/traits/query_free.hpp"
  23. #include "asio/traits/query_member.hpp"
  24. #include "asio/traits/query_static_constexpr_member.hpp"
  25. #include "asio/traits/static_query.hpp"
  26. #include "asio/traits/static_require.hpp"
  27. #include "asio/detail/push_options.hpp"
  28. namespace asio {
  29. #if defined(GENERATING_DOCUMENTATION)
  30. namespace execution {
  31. /// A property to communicate the forward progress and ordering guarantees of
  32. /// execution agents associated with the bulk execution.
  33. struct bulk_guarantee_t
  34. {
  35. /// The bulk_guarantee_t property applies to executors, senders, and
  36. /// schedulers.
  37. template <typename T>
  38. static constexpr bool is_applicable_property_v =
  39. is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
  40. /// The top-level bulk_guarantee_t property cannot be required.
  41. static constexpr bool is_requirable = false;
  42. /// The top-level bulk_guarantee_t property cannot be preferred.
  43. static constexpr bool is_preferable = false;
  44. /// The type returned by queries against an @c any_executor.
  45. typedef bulk_guarantee_t polymorphic_query_result_type;
  46. /// A sub-property that indicates that execution agents within the same bulk
  47. /// execution may be parallelised and vectorised.
  48. struct unsequenced_t
  49. {
  50. /// The bulk_guarantee_t::unsequenced_t property applies to executors,
  51. /// senders, and schedulers.
  52. template <typename T>
  53. static constexpr bool is_applicable_property_v =
  54. is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
  55. /// The bulk_guarantee_t::unsequenced_t property can be required.
  56. static constexpr bool is_requirable = true;
  57. /// The bulk_guarantee_t::unsequenced_t property can be preferred.
  58. static constexpr bool is_preferable = true;
  59. /// The type returned by queries against an @c any_executor.
  60. typedef bulk_guarantee_t polymorphic_query_result_type;
  61. /// Default constructor.
  62. constexpr unsequenced_t();
  63. /// Get the value associated with a property object.
  64. /**
  65. * @returns unsequenced_t();
  66. */
  67. static constexpr bulk_guarantee_t value();
  68. };
  69. /// A sub-property that indicates that execution agents within the same bulk
  70. /// execution may not be parallelised and vectorised.
  71. struct sequenced_t
  72. {
  73. /// The bulk_guarantee_t::sequenced_t property applies to executors,
  74. /// senders, and schedulers.
  75. template <typename T>
  76. static constexpr bool is_applicable_property_v =
  77. is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
  78. /// The bulk_guarantee_t::sequenced_t property can be required.
  79. static constexpr bool is_requirable = true;
  80. /// The bulk_guarantee_t::sequenced_t property can be preferred.
  81. static constexpr bool is_preferable = true;
  82. /// The type returned by queries against an @c any_executor.
  83. typedef bulk_guarantee_t polymorphic_query_result_type;
  84. /// Default constructor.
  85. constexpr sequenced_t();
  86. /// Get the value associated with a property object.
  87. /**
  88. * @returns sequenced_t();
  89. */
  90. static constexpr bulk_guarantee_t value();
  91. };
  92. /// A sub-property that indicates that execution agents within the same bulk
  93. /// execution may be parallelised.
  94. struct parallel_t
  95. {
  96. /// The bulk_guarantee_t::parallel_t property applies to executors,
  97. /// senders, and schedulers.
  98. template <typename T>
  99. static constexpr bool is_applicable_property_v =
  100. is_executor_v<T> || is_sender_v<T> || is_scheduler_v<T>;
  101. /// The bulk_guarantee_t::parallel_t property can be required.
  102. static constexpr bool is_requirable = true;
  103. /// The bulk_guarantee_t::parallel_t property can be preferred.
  104. static constexpr bool is_preferable = true;
  105. /// The type returned by queries against an @c any_executor.
  106. typedef bulk_guarantee_t polymorphic_query_result_type;
  107. /// Default constructor.
  108. constexpr parallel_t();
  109. /// Get the value associated with a property object.
  110. /**
  111. * @returns parallel_t();
  112. */
  113. static constexpr bulk_guarantee_t value();
  114. };
  115. /// A special value used for accessing the bulk_guarantee_t::unsequenced_t
  116. /// property.
  117. static constexpr unsequenced_t unsequenced;
  118. /// A special value used for accessing the bulk_guarantee_t::sequenced_t
  119. /// property.
  120. static constexpr sequenced_t sequenced;
  121. /// A special value used for accessing the bulk_guarantee_t::parallel_t
  122. /// property.
  123. static constexpr parallel_t parallel;
  124. /// Default constructor.
  125. constexpr bulk_guarantee_t();
  126. /// Construct from a sub-property value.
  127. constexpr bulk_guarantee_t(unsequenced_t);
  128. /// Construct from a sub-property value.
  129. constexpr bulk_guarantee_t(sequenced_t);
  130. /// Construct from a sub-property value.
  131. constexpr bulk_guarantee_t(parallel_t);
  132. /// Compare property values for equality.
  133. friend constexpr bool operator==(
  134. const bulk_guarantee_t& a, const bulk_guarantee_t& b) noexcept;
  135. /// Compare property values for inequality.
  136. friend constexpr bool operator!=(
  137. const bulk_guarantee_t& a, const bulk_guarantee_t& b) noexcept;
  138. };
  139. /// A special value used for accessing the bulk_guarantee_t property.
  140. constexpr bulk_guarantee_t bulk_guarantee;
  141. } // namespace execution
  142. #else // defined(GENERATING_DOCUMENTATION)
  143. namespace execution {
  144. namespace detail {
  145. namespace bulk_guarantee {
  146. template <int I> struct unsequenced_t;
  147. template <int I> struct sequenced_t;
  148. template <int I> struct parallel_t;
  149. } // namespace bulk_guarantee
  150. template <int I = 0>
  151. struct bulk_guarantee_t
  152. {
  153. #if defined(ASIO_HAS_VARIABLE_TEMPLATES)
  154. template <typename T>
  155. ASIO_STATIC_CONSTEXPR(bool,
  156. is_applicable_property_v = (
  157. is_executor<T>::value
  158. || conditional<
  159. is_executor<T>::value,
  160. false_type,
  161. is_sender<T>
  162. >::type::value
  163. || conditional<
  164. is_executor<T>::value,
  165. false_type,
  166. is_scheduler<T>
  167. >::type::value));
  168. #endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
  169. ASIO_STATIC_CONSTEXPR(bool, is_requirable = false);
  170. ASIO_STATIC_CONSTEXPR(bool, is_preferable = false);
  171. typedef bulk_guarantee_t polymorphic_query_result_type;
  172. typedef detail::bulk_guarantee::unsequenced_t<I> unsequenced_t;
  173. typedef detail::bulk_guarantee::sequenced_t<I> sequenced_t;
  174. typedef detail::bulk_guarantee::parallel_t<I> parallel_t;
  175. ASIO_CONSTEXPR bulk_guarantee_t()
  176. : value_(-1)
  177. {
  178. }
  179. ASIO_CONSTEXPR bulk_guarantee_t(unsequenced_t)
  180. : value_(0)
  181. {
  182. }
  183. ASIO_CONSTEXPR bulk_guarantee_t(sequenced_t)
  184. : value_(1)
  185. {
  186. }
  187. ASIO_CONSTEXPR bulk_guarantee_t(parallel_t)
  188. : value_(2)
  189. {
  190. }
  191. template <typename T>
  192. struct proxy
  193. {
  194. #if defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
  195. struct type
  196. {
  197. template <typename P>
  198. auto query(ASIO_MOVE_ARG(P) p) const
  199. noexcept(
  200. noexcept(
  201. declval<typename conditional<true, T, P>::type>().query(
  202. ASIO_MOVE_CAST(P)(p))
  203. )
  204. )
  205. -> decltype(
  206. declval<typename conditional<true, T, P>::type>().query(
  207. ASIO_MOVE_CAST(P)(p))
  208. );
  209. };
  210. #else // defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
  211. typedef T type;
  212. #endif // defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
  213. };
  214. template <typename T>
  215. struct static_proxy
  216. {
  217. #if defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
  218. struct type
  219. {
  220. template <typename P>
  221. static constexpr auto query(ASIO_MOVE_ARG(P) p)
  222. noexcept(
  223. noexcept(
  224. conditional<true, T, P>::type::query(ASIO_MOVE_CAST(P)(p))
  225. )
  226. )
  227. -> decltype(
  228. conditional<true, T, P>::type::query(ASIO_MOVE_CAST(P)(p))
  229. )
  230. {
  231. return T::query(ASIO_MOVE_CAST(P)(p));
  232. }
  233. };
  234. #else // defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
  235. typedef T type;
  236. #endif // defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
  237. };
  238. template <typename T>
  239. struct query_member :
  240. traits::query_member<typename proxy<T>::type, bulk_guarantee_t> {};
  241. template <typename T>
  242. struct query_static_constexpr_member :
  243. traits::query_static_constexpr_member<
  244. typename static_proxy<T>::type, bulk_guarantee_t> {};
  245. #if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
  246. && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
  247. template <typename T>
  248. static ASIO_CONSTEXPR
  249. typename query_static_constexpr_member<T>::result_type
  250. static_query()
  251. ASIO_NOEXCEPT_IF((
  252. query_static_constexpr_member<T>::is_noexcept))
  253. {
  254. return query_static_constexpr_member<T>::value();
  255. }
  256. template <typename T>
  257. static ASIO_CONSTEXPR
  258. typename traits::static_query<T, unsequenced_t>::result_type
  259. static_query(
  260. typename enable_if<
  261. !query_static_constexpr_member<T>::is_valid
  262. >::type* = 0,
  263. typename enable_if<
  264. !query_member<T>::is_valid
  265. >::type* = 0,
  266. typename enable_if<
  267. traits::static_query<T, unsequenced_t>::is_valid
  268. >::type* = 0) ASIO_NOEXCEPT
  269. {
  270. return traits::static_query<T, unsequenced_t>::value();
  271. }
  272. template <typename T>
  273. static ASIO_CONSTEXPR
  274. typename traits::static_query<T, sequenced_t>::result_type
  275. static_query(
  276. typename enable_if<
  277. !query_static_constexpr_member<T>::is_valid
  278. >::type* = 0,
  279. typename enable_if<
  280. !query_member<T>::is_valid
  281. >::type* = 0,
  282. typename enable_if<
  283. !traits::static_query<T, unsequenced_t>::is_valid
  284. >::type* = 0,
  285. typename enable_if<
  286. traits::static_query<T, sequenced_t>::is_valid
  287. >::type* = 0) ASIO_NOEXCEPT
  288. {
  289. return traits::static_query<T, sequenced_t>::value();
  290. }
  291. template <typename T>
  292. static ASIO_CONSTEXPR
  293. typename traits::static_query<T, parallel_t>::result_type
  294. static_query(
  295. typename enable_if<
  296. !query_static_constexpr_member<T>::is_valid
  297. >::type* = 0,
  298. typename enable_if<
  299. !query_member<T>::is_valid
  300. >::type* = 0,
  301. typename enable_if<
  302. !traits::static_query<T, unsequenced_t>::is_valid
  303. >::type* = 0,
  304. typename enable_if<
  305. !traits::static_query<T, sequenced_t>::is_valid
  306. >::type* = 0,
  307. typename enable_if<
  308. traits::static_query<T, parallel_t>::is_valid
  309. >::type* = 0) ASIO_NOEXCEPT
  310. {
  311. return traits::static_query<T, parallel_t>::value();
  312. }
  313. template <typename E,
  314. typename T = decltype(bulk_guarantee_t::static_query<E>())>
  315. static ASIO_CONSTEXPR const T static_query_v
  316. = bulk_guarantee_t::static_query<E>();
  317. #endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
  318. // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
  319. friend ASIO_CONSTEXPR bool operator==(
  320. const bulk_guarantee_t& a, const bulk_guarantee_t& b)
  321. {
  322. return a.value_ == b.value_;
  323. }
  324. friend ASIO_CONSTEXPR bool operator!=(
  325. const bulk_guarantee_t& a, const bulk_guarantee_t& b)
  326. {
  327. return a.value_ != b.value_;
  328. }
  329. struct convertible_from_bulk_guarantee_t
  330. {
  331. ASIO_CONSTEXPR convertible_from_bulk_guarantee_t(bulk_guarantee_t) {}
  332. };
  333. template <typename Executor>
  334. friend ASIO_CONSTEXPR bulk_guarantee_t query(
  335. const Executor& ex, convertible_from_bulk_guarantee_t,
  336. typename enable_if<
  337. can_query<const Executor&, unsequenced_t>::value
  338. >::type* = 0)
  339. #if !defined(__clang__) // Clang crashes if noexcept is used here.
  340. #if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified.
  341. ASIO_NOEXCEPT_IF((
  342. is_nothrow_query<const Executor&,
  343. bulk_guarantee_t<>::unsequenced_t>::value))
  344. #else // defined(ASIO_MSVC)
  345. ASIO_NOEXCEPT_IF((
  346. is_nothrow_query<const Executor&, unsequenced_t>::value))
  347. #endif // defined(ASIO_MSVC)
  348. #endif // !defined(__clang__)
  349. {
  350. return asio::query(ex, unsequenced_t());
  351. }
  352. template <typename Executor>
  353. friend ASIO_CONSTEXPR bulk_guarantee_t query(
  354. const Executor& ex, convertible_from_bulk_guarantee_t,
  355. typename enable_if<
  356. !can_query<const Executor&, unsequenced_t>::value
  357. >::type* = 0,
  358. typename enable_if<
  359. can_query<const Executor&, sequenced_t>::value
  360. >::type* = 0)
  361. #if !defined(__clang__) // Clang crashes if noexcept is used here.
  362. #if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified.
  363. ASIO_NOEXCEPT_IF((
  364. is_nothrow_query<const Executor&,
  365. bulk_guarantee_t<>::sequenced_t>::value))
  366. #else // defined(ASIO_MSVC)
  367. ASIO_NOEXCEPT_IF((
  368. is_nothrow_query<const Executor&, sequenced_t>::value))
  369. #endif // defined(ASIO_MSVC)
  370. #endif // !defined(__clang__)
  371. {
  372. return asio::query(ex, sequenced_t());
  373. }
  374. template <typename Executor>
  375. friend ASIO_CONSTEXPR bulk_guarantee_t query(
  376. const Executor& ex, convertible_from_bulk_guarantee_t,
  377. typename enable_if<
  378. !can_query<const Executor&, unsequenced_t>::value
  379. >::type* = 0,
  380. typename enable_if<
  381. !can_query<const Executor&, sequenced_t>::value
  382. >::type* = 0,
  383. typename enable_if<
  384. can_query<const Executor&, parallel_t>::value
  385. >::type* = 0)
  386. #if !defined(__clang__) // Clang crashes if noexcept is used here.
  387. #if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified.
  388. ASIO_NOEXCEPT_IF((
  389. is_nothrow_query<const Executor&, bulk_guarantee_t<>::parallel_t>::value))
  390. #else // defined(ASIO_MSVC)
  391. ASIO_NOEXCEPT_IF((
  392. is_nothrow_query<const Executor&, parallel_t>::value))
  393. #endif // defined(ASIO_MSVC)
  394. #endif // !defined(__clang__)
  395. {
  396. return asio::query(ex, parallel_t());
  397. }
  398. ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(unsequenced_t, unsequenced);
  399. ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(sequenced_t, sequenced);
  400. ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(parallel_t, parallel);
  401. #if !defined(ASIO_HAS_CONSTEXPR)
  402. static const bulk_guarantee_t instance;
  403. #endif // !defined(ASIO_HAS_CONSTEXPR)
  404. private:
  405. int value_;
  406. };
  407. #if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
  408. && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
  409. template <int I> template <typename E, typename T>
  410. const T bulk_guarantee_t<I>::static_query_v;
  411. #endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
  412. // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
  413. #if !defined(ASIO_HAS_CONSTEXPR)
  414. template <int I>
  415. const bulk_guarantee_t<I> bulk_guarantee_t<I>::instance;
  416. #endif
  417. template <int I>
  418. const typename bulk_guarantee_t<I>::unsequenced_t
  419. bulk_guarantee_t<I>::unsequenced;
  420. template <int I>
  421. const typename bulk_guarantee_t<I>::sequenced_t
  422. bulk_guarantee_t<I>::sequenced;
  423. template <int I>
  424. const typename bulk_guarantee_t<I>::parallel_t
  425. bulk_guarantee_t<I>::parallel;
  426. namespace bulk_guarantee {
  427. template <int I = 0>
  428. struct unsequenced_t
  429. {
  430. #if defined(ASIO_HAS_VARIABLE_TEMPLATES)
  431. template <typename T>
  432. ASIO_STATIC_CONSTEXPR(bool,
  433. is_applicable_property_v = (
  434. is_executor<T>::value
  435. || conditional<
  436. is_executor<T>::value,
  437. false_type,
  438. is_sender<T>
  439. >::type::value
  440. || conditional<
  441. is_executor<T>::value,
  442. false_type,
  443. is_scheduler<T>
  444. >::type::value));
  445. #endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
  446. ASIO_STATIC_CONSTEXPR(bool, is_requirable = true);
  447. ASIO_STATIC_CONSTEXPR(bool, is_preferable = true);
  448. typedef bulk_guarantee_t<I> polymorphic_query_result_type;
  449. ASIO_CONSTEXPR unsequenced_t()
  450. {
  451. }
  452. template <typename T>
  453. struct query_member :
  454. traits::query_member<
  455. typename bulk_guarantee_t<I>::template proxy<T>::type,
  456. unsequenced_t> {};
  457. template <typename T>
  458. struct query_static_constexpr_member :
  459. traits::query_static_constexpr_member<
  460. typename bulk_guarantee_t<I>::template static_proxy<T>::type,
  461. unsequenced_t> {};
  462. #if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
  463. && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
  464. template <typename T>
  465. static ASIO_CONSTEXPR
  466. typename query_static_constexpr_member<T>::result_type
  467. static_query()
  468. ASIO_NOEXCEPT_IF((
  469. query_static_constexpr_member<T>::is_noexcept))
  470. {
  471. return query_static_constexpr_member<T>::value();
  472. }
  473. template <typename T>
  474. static ASIO_CONSTEXPR unsequenced_t static_query(
  475. typename enable_if<
  476. !query_static_constexpr_member<T>::is_valid
  477. >::type* = 0,
  478. typename enable_if<
  479. !query_member<T>::is_valid
  480. >::type* = 0,
  481. typename enable_if<
  482. !traits::query_free<T, unsequenced_t>::is_valid
  483. >::type* = 0,
  484. typename enable_if<
  485. !can_query<T, sequenced_t<I> >::value
  486. >::type* = 0,
  487. typename enable_if<
  488. !can_query<T, parallel_t<I> >::value
  489. >::type* = 0) ASIO_NOEXCEPT
  490. {
  491. return unsequenced_t();
  492. }
  493. template <typename E, typename T = decltype(unsequenced_t::static_query<E>())>
  494. static ASIO_CONSTEXPR const T static_query_v
  495. = unsequenced_t::static_query<E>();
  496. #endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
  497. // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
  498. static ASIO_CONSTEXPR bulk_guarantee_t<I> value()
  499. {
  500. return unsequenced_t();
  501. }
  502. friend ASIO_CONSTEXPR bool operator==(
  503. const unsequenced_t&, const unsequenced_t&)
  504. {
  505. return true;
  506. }
  507. friend ASIO_CONSTEXPR bool operator!=(
  508. const unsequenced_t&, const unsequenced_t&)
  509. {
  510. return false;
  511. }
  512. friend ASIO_CONSTEXPR bool operator==(
  513. const unsequenced_t&, const sequenced_t<I>&)
  514. {
  515. return false;
  516. }
  517. friend ASIO_CONSTEXPR bool operator!=(
  518. const unsequenced_t&, const sequenced_t<I>&)
  519. {
  520. return true;
  521. }
  522. friend ASIO_CONSTEXPR bool operator==(
  523. const unsequenced_t&, const parallel_t<I>&)
  524. {
  525. return false;
  526. }
  527. friend ASIO_CONSTEXPR bool operator!=(
  528. const unsequenced_t&, const parallel_t<I>&)
  529. {
  530. return true;
  531. }
  532. };
  533. #if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
  534. && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
  535. template <int I> template <typename E, typename T>
  536. const T unsequenced_t<I>::static_query_v;
  537. #endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
  538. // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
  539. template <int I = 0>
  540. struct sequenced_t
  541. {
  542. #if defined(ASIO_HAS_VARIABLE_TEMPLATES)
  543. template <typename T>
  544. ASIO_STATIC_CONSTEXPR(bool,
  545. is_applicable_property_v = (
  546. is_executor<T>::value
  547. || conditional<
  548. is_executor<T>::value,
  549. false_type,
  550. is_sender<T>
  551. >::type::value
  552. || conditional<
  553. is_executor<T>::value,
  554. false_type,
  555. is_scheduler<T>
  556. >::type::value));
  557. #endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
  558. ASIO_STATIC_CONSTEXPR(bool, is_requirable = true);
  559. ASIO_STATIC_CONSTEXPR(bool, is_preferable = true);
  560. typedef bulk_guarantee_t<I> polymorphic_query_result_type;
  561. ASIO_CONSTEXPR sequenced_t()
  562. {
  563. }
  564. template <typename T>
  565. struct query_member :
  566. traits::query_member<
  567. typename bulk_guarantee_t<I>::template proxy<T>::type,
  568. sequenced_t> {};
  569. template <typename T>
  570. struct query_static_constexpr_member :
  571. traits::query_static_constexpr_member<
  572. typename bulk_guarantee_t<I>::template static_proxy<T>::type,
  573. sequenced_t> {};
  574. #if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
  575. && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
  576. template <typename T>
  577. static ASIO_CONSTEXPR
  578. typename query_static_constexpr_member<T>::result_type
  579. static_query()
  580. ASIO_NOEXCEPT_IF((
  581. query_static_constexpr_member<T>::is_noexcept))
  582. {
  583. return query_static_constexpr_member<T>::value();
  584. }
  585. template <typename E, typename T = decltype(sequenced_t::static_query<E>())>
  586. static ASIO_CONSTEXPR const T static_query_v
  587. = sequenced_t::static_query<E>();
  588. #endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
  589. // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
  590. static ASIO_CONSTEXPR bulk_guarantee_t<I> value()
  591. {
  592. return sequenced_t();
  593. }
  594. friend ASIO_CONSTEXPR bool operator==(
  595. const sequenced_t&, const sequenced_t&)
  596. {
  597. return true;
  598. }
  599. friend ASIO_CONSTEXPR bool operator!=(
  600. const sequenced_t&, const sequenced_t&)
  601. {
  602. return false;
  603. }
  604. friend ASIO_CONSTEXPR bool operator==(
  605. const sequenced_t&, const unsequenced_t<I>&)
  606. {
  607. return false;
  608. }
  609. friend ASIO_CONSTEXPR bool operator!=(
  610. const sequenced_t&, const unsequenced_t<I>&)
  611. {
  612. return true;
  613. }
  614. friend ASIO_CONSTEXPR bool operator==(
  615. const sequenced_t&, const parallel_t<I>&)
  616. {
  617. return false;
  618. }
  619. friend ASIO_CONSTEXPR bool operator!=(
  620. const sequenced_t&, const parallel_t<I>&)
  621. {
  622. return true;
  623. }
  624. };
  625. #if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
  626. && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
  627. template <int I> template <typename E, typename T>
  628. const T sequenced_t<I>::static_query_v;
  629. #endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
  630. // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
  631. template <int I>
  632. struct parallel_t
  633. {
  634. #if defined(ASIO_HAS_VARIABLE_TEMPLATES)
  635. template <typename T>
  636. ASIO_STATIC_CONSTEXPR(bool,
  637. is_applicable_property_v = (
  638. is_executor<T>::value
  639. || conditional<
  640. is_executor<T>::value,
  641. false_type,
  642. is_sender<T>
  643. >::type::value
  644. || conditional<
  645. is_executor<T>::value,
  646. false_type,
  647. is_scheduler<T>
  648. >::type::value));
  649. #endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
  650. ASIO_STATIC_CONSTEXPR(bool, is_requirable = true);
  651. ASIO_STATIC_CONSTEXPR(bool, is_preferable = true);
  652. typedef bulk_guarantee_t<I> polymorphic_query_result_type;
  653. ASIO_CONSTEXPR parallel_t()
  654. {
  655. }
  656. template <typename T>
  657. struct query_member :
  658. traits::query_member<
  659. typename bulk_guarantee_t<I>::template proxy<T>::type,
  660. parallel_t> {};
  661. template <typename T>
  662. struct query_static_constexpr_member :
  663. traits::query_static_constexpr_member<
  664. typename bulk_guarantee_t<I>::template static_proxy<T>::type,
  665. parallel_t> {};
  666. #if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
  667. && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
  668. template <typename T>
  669. static ASIO_CONSTEXPR
  670. typename query_static_constexpr_member<T>::result_type
  671. static_query()
  672. ASIO_NOEXCEPT_IF((
  673. query_static_constexpr_member<T>::is_noexcept))
  674. {
  675. return query_static_constexpr_member<T>::value();
  676. }
  677. template <typename E, typename T = decltype(parallel_t::static_query<E>())>
  678. static ASIO_CONSTEXPR const T static_query_v
  679. = parallel_t::static_query<E>();
  680. #endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
  681. // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
  682. static ASIO_CONSTEXPR bulk_guarantee_t<I> value()
  683. {
  684. return parallel_t();
  685. }
  686. friend ASIO_CONSTEXPR bool operator==(
  687. const parallel_t&, const parallel_t&)
  688. {
  689. return true;
  690. }
  691. friend ASIO_CONSTEXPR bool operator!=(
  692. const parallel_t&, const parallel_t&)
  693. {
  694. return false;
  695. }
  696. friend ASIO_CONSTEXPR bool operator==(
  697. const parallel_t&, const unsequenced_t<I>&)
  698. {
  699. return false;
  700. }
  701. friend ASIO_CONSTEXPR bool operator!=(
  702. const parallel_t&, const unsequenced_t<I>&)
  703. {
  704. return true;
  705. }
  706. friend ASIO_CONSTEXPR bool operator==(
  707. const parallel_t&, const sequenced_t<I>&)
  708. {
  709. return false;
  710. }
  711. friend ASIO_CONSTEXPR bool operator!=(
  712. const parallel_t&, const sequenced_t<I>&)
  713. {
  714. return true;
  715. }
  716. };
  717. #if defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
  718. && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
  719. template <int I> template <typename E, typename T>
  720. const T parallel_t<I>::static_query_v;
  721. #endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
  722. // && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
  723. } // namespace bulk_guarantee
  724. } // namespace detail
  725. typedef detail::bulk_guarantee_t<> bulk_guarantee_t;
  726. #if defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
  727. constexpr bulk_guarantee_t bulk_guarantee;
  728. #else // defined(ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
  729. namespace { static const bulk_guarantee_t&
  730. bulk_guarantee = bulk_guarantee_t::instance; }
  731. #endif
  732. } // namespace execution
  733. #if !defined(ASIO_HAS_VARIABLE_TEMPLATES)
  734. template <typename T>
  735. struct is_applicable_property<T, execution::bulk_guarantee_t>
  736. : integral_constant<bool,
  737. execution::is_executor<T>::value
  738. || conditional<
  739. execution::is_executor<T>::value,
  740. false_type,
  741. execution::is_sender<T>
  742. >::type::value
  743. || conditional<
  744. execution::is_executor<T>::value,
  745. false_type,
  746. execution::is_scheduler<T>
  747. >::type::value>
  748. {
  749. };
  750. template <typename T>
  751. struct is_applicable_property<T, execution::bulk_guarantee_t::unsequenced_t>
  752. : integral_constant<bool,
  753. execution::is_executor<T>::value
  754. || conditional<
  755. execution::is_executor<T>::value,
  756. false_type,
  757. execution::is_sender<T>
  758. >::type::value
  759. || conditional<
  760. execution::is_executor<T>::value,
  761. false_type,
  762. execution::is_scheduler<T>
  763. >::type::value>
  764. {
  765. };
  766. template <typename T>
  767. struct is_applicable_property<T, execution::bulk_guarantee_t::sequenced_t>
  768. : integral_constant<bool,
  769. execution::is_executor<T>::value
  770. || conditional<
  771. execution::is_executor<T>::value,
  772. false_type,
  773. execution::is_sender<T>
  774. >::type::value
  775. || conditional<
  776. execution::is_executor<T>::value,
  777. false_type,
  778. execution::is_scheduler<T>
  779. >::type::value>
  780. {
  781. };
  782. template <typename T>
  783. struct is_applicable_property<T, execution::bulk_guarantee_t::parallel_t>
  784. : integral_constant<bool,
  785. execution::is_executor<T>::value
  786. || conditional<
  787. execution::is_executor<T>::value,
  788. false_type,
  789. execution::is_sender<T>
  790. >::type::value
  791. || conditional<
  792. execution::is_executor<T>::value,
  793. false_type,
  794. execution::is_scheduler<T>
  795. >::type::value>
  796. {
  797. };
  798. #endif // !defined(ASIO_HAS_VARIABLE_TEMPLATES)
  799. namespace traits {
  800. #if !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
  801. template <typename T>
  802. struct query_free_default<T, execution::bulk_guarantee_t,
  803. typename enable_if<
  804. can_query<T, execution::bulk_guarantee_t::unsequenced_t>::value
  805. >::type>
  806. {
  807. ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
  808. ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
  809. (is_nothrow_query<T, execution::bulk_guarantee_t::unsequenced_t>::value));
  810. typedef execution::bulk_guarantee_t result_type;
  811. };
  812. template <typename T>
  813. struct query_free_default<T, execution::bulk_guarantee_t,
  814. typename enable_if<
  815. !can_query<T, execution::bulk_guarantee_t::unsequenced_t>::value
  816. && can_query<T, execution::bulk_guarantee_t::sequenced_t>::value
  817. >::type>
  818. {
  819. ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
  820. ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
  821. (is_nothrow_query<T, execution::bulk_guarantee_t::sequenced_t>::value));
  822. typedef execution::bulk_guarantee_t result_type;
  823. };
  824. template <typename T>
  825. struct query_free_default<T, execution::bulk_guarantee_t,
  826. typename enable_if<
  827. !can_query<T, execution::bulk_guarantee_t::unsequenced_t>::value
  828. && !can_query<T, execution::bulk_guarantee_t::sequenced_t>::value
  829. && can_query<T, execution::bulk_guarantee_t::parallel_t>::value
  830. >::type>
  831. {
  832. ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
  833. ASIO_STATIC_CONSTEXPR(bool, is_noexcept =
  834. (is_nothrow_query<T, execution::bulk_guarantee_t::parallel_t>::value));
  835. typedef execution::bulk_guarantee_t result_type;
  836. };
  837. #endif // !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
  838. #if !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
  839. || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
  840. template <typename T>
  841. struct static_query<T, execution::bulk_guarantee_t,
  842. typename enable_if<
  843. execution::detail::bulk_guarantee_t<0>::
  844. query_static_constexpr_member<T>::is_valid
  845. >::type>
  846. {
  847. ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
  848. ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
  849. typedef typename execution::detail::bulk_guarantee_t<0>::
  850. query_static_constexpr_member<T>::result_type result_type;
  851. static ASIO_CONSTEXPR result_type value()
  852. {
  853. return execution::detail::bulk_guarantee_t<0>::
  854. query_static_constexpr_member<T>::value();
  855. }
  856. };
  857. template <typename T>
  858. struct static_query<T, execution::bulk_guarantee_t,
  859. typename enable_if<
  860. !execution::detail::bulk_guarantee_t<0>::
  861. query_static_constexpr_member<T>::is_valid
  862. && !execution::detail::bulk_guarantee_t<0>::
  863. query_member<T>::is_valid
  864. && traits::static_query<T,
  865. execution::bulk_guarantee_t::unsequenced_t>::is_valid
  866. >::type>
  867. {
  868. ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
  869. ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
  870. typedef typename traits::static_query<T,
  871. execution::bulk_guarantee_t::unsequenced_t>::result_type result_type;
  872. static ASIO_CONSTEXPR result_type value()
  873. {
  874. return traits::static_query<T,
  875. execution::bulk_guarantee_t::unsequenced_t>::value();
  876. }
  877. };
  878. template <typename T>
  879. struct static_query<T, execution::bulk_guarantee_t,
  880. typename enable_if<
  881. !execution::detail::bulk_guarantee_t<0>::
  882. query_static_constexpr_member<T>::is_valid
  883. && !execution::detail::bulk_guarantee_t<0>::
  884. query_member<T>::is_valid
  885. && !traits::static_query<T,
  886. execution::bulk_guarantee_t::unsequenced_t>::is_valid
  887. && traits::static_query<T,
  888. execution::bulk_guarantee_t::sequenced_t>::is_valid
  889. >::type>
  890. {
  891. ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
  892. ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
  893. typedef typename traits::static_query<T,
  894. execution::bulk_guarantee_t::sequenced_t>::result_type result_type;
  895. static ASIO_CONSTEXPR result_type value()
  896. {
  897. return traits::static_query<T,
  898. execution::bulk_guarantee_t::sequenced_t>::value();
  899. }
  900. };
  901. template <typename T>
  902. struct static_query<T, execution::bulk_guarantee_t,
  903. typename enable_if<
  904. !execution::detail::bulk_guarantee_t<0>::
  905. query_static_constexpr_member<T>::is_valid
  906. && !execution::detail::bulk_guarantee_t<0>::
  907. query_member<T>::is_valid
  908. && !traits::static_query<T,
  909. execution::bulk_guarantee_t::unsequenced_t>::is_valid
  910. && !traits::static_query<T,
  911. execution::bulk_guarantee_t::sequenced_t>::is_valid
  912. && traits::static_query<T,
  913. execution::bulk_guarantee_t::parallel_t>::is_valid
  914. >::type>
  915. {
  916. ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
  917. ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
  918. typedef typename traits::static_query<T,
  919. execution::bulk_guarantee_t::parallel_t>::result_type result_type;
  920. static ASIO_CONSTEXPR result_type value()
  921. {
  922. return traits::static_query<T,
  923. execution::bulk_guarantee_t::parallel_t>::value();
  924. }
  925. };
  926. template <typename T>
  927. struct static_query<T, execution::bulk_guarantee_t::unsequenced_t,
  928. typename enable_if<
  929. execution::detail::bulk_guarantee::unsequenced_t<0>::
  930. query_static_constexpr_member<T>::is_valid
  931. >::type>
  932. {
  933. ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
  934. ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
  935. typedef typename execution::detail::bulk_guarantee::unsequenced_t<0>::
  936. query_static_constexpr_member<T>::result_type result_type;
  937. static ASIO_CONSTEXPR result_type value()
  938. {
  939. return execution::detail::bulk_guarantee::unsequenced_t<0>::
  940. query_static_constexpr_member<T>::value();
  941. }
  942. };
  943. template <typename T>
  944. struct static_query<T, execution::bulk_guarantee_t::unsequenced_t,
  945. typename enable_if<
  946. !execution::detail::bulk_guarantee::unsequenced_t<0>::
  947. query_static_constexpr_member<T>::is_valid
  948. && !execution::detail::bulk_guarantee::unsequenced_t<0>::
  949. query_member<T>::is_valid
  950. && !traits::query_free<T,
  951. execution::bulk_guarantee_t::unsequenced_t>::is_valid
  952. && !can_query<T, execution::bulk_guarantee_t::sequenced_t>::value
  953. && !can_query<T, execution::bulk_guarantee_t::parallel_t>::value
  954. >::type>
  955. {
  956. ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
  957. ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
  958. typedef execution::bulk_guarantee_t::unsequenced_t result_type;
  959. static ASIO_CONSTEXPR result_type value()
  960. {
  961. return result_type();
  962. }
  963. };
  964. template <typename T>
  965. struct static_query<T, execution::bulk_guarantee_t::sequenced_t,
  966. typename enable_if<
  967. execution::detail::bulk_guarantee::sequenced_t<0>::
  968. query_static_constexpr_member<T>::is_valid
  969. >::type>
  970. {
  971. ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
  972. ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
  973. typedef typename execution::detail::bulk_guarantee::sequenced_t<0>::
  974. query_static_constexpr_member<T>::result_type result_type;
  975. static ASIO_CONSTEXPR result_type value()
  976. {
  977. return execution::detail::bulk_guarantee::sequenced_t<0>::
  978. query_static_constexpr_member<T>::value();
  979. }
  980. };
  981. template <typename T>
  982. struct static_query<T, execution::bulk_guarantee_t::parallel_t,
  983. typename enable_if<
  984. execution::detail::bulk_guarantee::parallel_t<0>::
  985. query_static_constexpr_member<T>::is_valid
  986. >::type>
  987. {
  988. ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
  989. ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
  990. typedef typename execution::detail::bulk_guarantee::parallel_t<0>::
  991. query_static_constexpr_member<T>::result_type result_type;
  992. static ASIO_CONSTEXPR result_type value()
  993. {
  994. return execution::detail::bulk_guarantee::parallel_t<0>::
  995. query_static_constexpr_member<T>::value();
  996. }
  997. };
  998. #endif // !defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
  999. // || !defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
  1000. #if !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT)
  1001. template <typename T>
  1002. struct static_require<T, execution::bulk_guarantee_t::unsequenced_t,
  1003. typename enable_if<
  1004. static_query<T, execution::bulk_guarantee_t::unsequenced_t>::is_valid
  1005. >::type>
  1006. {
  1007. ASIO_STATIC_CONSTEXPR(bool, is_valid =
  1008. (is_same<typename static_query<T,
  1009. execution::bulk_guarantee_t::unsequenced_t>::result_type,
  1010. execution::bulk_guarantee_t::unsequenced_t>::value));
  1011. };
  1012. template <typename T>
  1013. struct static_require<T, execution::bulk_guarantee_t::sequenced_t,
  1014. typename enable_if<
  1015. static_query<T, execution::bulk_guarantee_t::sequenced_t>::is_valid
  1016. >::type>
  1017. {
  1018. ASIO_STATIC_CONSTEXPR(bool, is_valid =
  1019. (is_same<typename static_query<T,
  1020. execution::bulk_guarantee_t::sequenced_t>::result_type,
  1021. execution::bulk_guarantee_t::sequenced_t>::value));
  1022. };
  1023. template <typename T>
  1024. struct static_require<T, execution::bulk_guarantee_t::parallel_t,
  1025. typename enable_if<
  1026. static_query<T, execution::bulk_guarantee_t::parallel_t>::is_valid
  1027. >::type>
  1028. {
  1029. ASIO_STATIC_CONSTEXPR(bool, is_valid =
  1030. (is_same<typename static_query<T,
  1031. execution::bulk_guarantee_t::parallel_t>::result_type,
  1032. execution::bulk_guarantee_t::parallel_t>::value));
  1033. };
  1034. #endif // !defined(ASIO_HAS_DEDUCED_STATIC_REQUIRE_TRAIT)
  1035. } // namespace traits
  1036. #endif // defined(GENERATING_DOCUMENTATION)
  1037. } // namespace asio
  1038. #include "asio/detail/pop_options.hpp"
  1039. #endif // ASIO_EXECUTION_BULK_GUARANTEE_HPP