bulk_guarantee.hpp 36 KB

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