Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:43:17

0001 //
0002 // execution/outstanding_work.hpp
0003 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0004 //
0005 // Copyright (c) 2003-2025 Christopher M. Kohlhoff (chris at kohlhoff dot com)
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0008 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0009 //
0010 
0011 #ifndef BOOST_ASIO_EXECUTION_OUTSTANDING_WORK_HPP
0012 #define BOOST_ASIO_EXECUTION_OUTSTANDING_WORK_HPP
0013 
0014 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
0015 # pragma once
0016 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
0017 
0018 #include <boost/asio/detail/config.hpp>
0019 #include <boost/asio/detail/type_traits.hpp>
0020 #include <boost/asio/execution/executor.hpp>
0021 #include <boost/asio/is_applicable_property.hpp>
0022 #include <boost/asio/query.hpp>
0023 #include <boost/asio/traits/query_free.hpp>
0024 #include <boost/asio/traits/query_member.hpp>
0025 #include <boost/asio/traits/query_static_constexpr_member.hpp>
0026 #include <boost/asio/traits/static_query.hpp>
0027 #include <boost/asio/traits/static_require.hpp>
0028 
0029 #include <boost/asio/detail/push_options.hpp>
0030 
0031 namespace boost {
0032 namespace asio {
0033 
0034 #if defined(GENERATING_DOCUMENTATION)
0035 
0036 namespace execution {
0037 
0038 /// A property to describe whether task submission is likely in the future.
0039 struct outstanding_work_t
0040 {
0041   /// The outstanding_work_t property applies to executors.
0042   template <typename T>
0043   static constexpr bool is_applicable_property_v = is_executor_v<T>;
0044 
0045   /// The top-level outstanding_work_t property cannot be required.
0046   static constexpr bool is_requirable = false;
0047 
0048   /// The top-level outstanding_work_t property cannot be preferred.
0049   static constexpr bool is_preferable = false;
0050 
0051   /// The type returned by queries against an @c any_executor.
0052   typedef outstanding_work_t polymorphic_query_result_type;
0053 
0054   /// A sub-property that indicates that the executor does not represent likely
0055   /// future submission of a function object.
0056   struct untracked_t
0057   {
0058     /// The outstanding_work_t::untracked_t property applies to executors.
0059     template <typename T>
0060     static constexpr bool is_applicable_property_v = is_executor_v<T>;
0061 
0062     /// The outstanding_work_t::untracked_t property can be required.
0063     static constexpr bool is_requirable = true;
0064 
0065     /// The outstanding_work_t::untracked_t property can be preferred.
0066     static constexpr bool is_preferable = true;
0067 
0068     /// The type returned by queries against an @c any_executor.
0069     typedef outstanding_work_t polymorphic_query_result_type;
0070 
0071     /// Default constructor.
0072     constexpr untracked_t();
0073 
0074     /// Get the value associated with a property object.
0075     /**
0076      * @returns untracked_t();
0077      */
0078     static constexpr outstanding_work_t value();
0079   };
0080 
0081   /// A sub-property that indicates that the executor represents likely
0082   /// future submission of a function object.
0083   struct tracked_t
0084   {
0085     /// The outstanding_work_t::untracked_t property applies to executors.
0086     template <typename T>
0087     static constexpr bool is_applicable_property_v = is_executor_v<T>;
0088 
0089     /// The outstanding_work_t::tracked_t property can be required.
0090     static constexpr bool is_requirable = true;
0091 
0092     /// The outstanding_work_t::tracked_t property can be preferred.
0093     static constexpr bool is_preferable = true;
0094 
0095     /// The type returned by queries against an @c any_executor.
0096     typedef outstanding_work_t polymorphic_query_result_type;
0097 
0098     /// Default constructor.
0099     constexpr tracked_t();
0100 
0101     /// Get the value associated with a property object.
0102     /**
0103      * @returns tracked_t();
0104      */
0105     static constexpr outstanding_work_t value();
0106   };
0107 
0108   /// A special value used for accessing the outstanding_work_t::untracked_t
0109   /// property.
0110   static constexpr untracked_t untracked;
0111 
0112   /// A special value used for accessing the outstanding_work_t::tracked_t
0113   /// property.
0114   static constexpr tracked_t tracked;
0115 
0116   /// Default constructor.
0117   constexpr outstanding_work_t();
0118 
0119   /// Construct from a sub-property value.
0120   constexpr outstanding_work_t(untracked_t);
0121 
0122   /// Construct from a sub-property value.
0123   constexpr outstanding_work_t(tracked_t);
0124 
0125   /// Compare property values for equality.
0126   friend constexpr bool operator==(
0127       const outstanding_work_t& a, const outstanding_work_t& b) noexcept;
0128 
0129   /// Compare property values for inequality.
0130   friend constexpr bool operator!=(
0131       const outstanding_work_t& a, const outstanding_work_t& b) noexcept;
0132 };
0133 
0134 /// A special value used for accessing the outstanding_work_t property.
0135 constexpr outstanding_work_t outstanding_work;
0136 
0137 } // namespace execution
0138 
0139 #else // defined(GENERATING_DOCUMENTATION)
0140 
0141 namespace execution {
0142 namespace detail {
0143 namespace outstanding_work {
0144 
0145 template <int I> struct untracked_t;
0146 template <int I> struct tracked_t;
0147 
0148 } // namespace outstanding_work
0149 
0150 template <int I = 0>
0151 struct outstanding_work_t
0152 {
0153 #if defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES)
0154   template <typename T>
0155   static constexpr bool is_applicable_property_v = is_executor<T>::value;
0156 #endif // defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES)
0157 
0158   static constexpr bool is_requirable = false;
0159   static constexpr bool is_preferable = false;
0160   typedef outstanding_work_t polymorphic_query_result_type;
0161 
0162   typedef detail::outstanding_work::untracked_t<I> untracked_t;
0163   typedef detail::outstanding_work::tracked_t<I> tracked_t;
0164 
0165   constexpr outstanding_work_t()
0166     : value_(-1)
0167   {
0168   }
0169 
0170   constexpr outstanding_work_t(untracked_t)
0171     : value_(0)
0172   {
0173   }
0174 
0175   constexpr outstanding_work_t(tracked_t)
0176     : value_(1)
0177   {
0178   }
0179 
0180   template <typename T>
0181   struct proxy
0182   {
0183 #if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
0184     struct type
0185     {
0186       template <typename P>
0187       auto query(P&& p) const
0188         noexcept(
0189           noexcept(
0190             declval<conditional_t<true, T, P>>().query(static_cast<P&&>(p))
0191           )
0192         )
0193         -> decltype(
0194           declval<conditional_t<true, T, P>>().query(static_cast<P&&>(p))
0195         );
0196     };
0197 #else // defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
0198     typedef T type;
0199 #endif // defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
0200   };
0201 
0202   template <typename T>
0203   struct static_proxy
0204   {
0205 #if defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
0206     struct type
0207     {
0208       template <typename P>
0209       static constexpr auto query(P&& p)
0210         noexcept(
0211           noexcept(
0212             conditional_t<true, T, P>::query(static_cast<P&&>(p))
0213           )
0214         )
0215         -> decltype(
0216           conditional_t<true, T, P>::query(static_cast<P&&>(p))
0217         )
0218       {
0219         return T::query(static_cast<P&&>(p));
0220       }
0221     };
0222 #else // defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
0223     typedef T type;
0224 #endif // defined(BOOST_ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
0225   };
0226 
0227   template <typename T>
0228   struct query_member :
0229     traits::query_member<typename proxy<T>::type, outstanding_work_t> {};
0230 
0231   template <typename T>
0232   struct query_static_constexpr_member :
0233     traits::query_static_constexpr_member<
0234       typename static_proxy<T>::type, outstanding_work_t> {};
0235 
0236 #if defined(BOOST_ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
0237   && defined(BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
0238   template <typename T>
0239   static constexpr
0240   typename query_static_constexpr_member<T>::result_type
0241   static_query()
0242     noexcept(query_static_constexpr_member<T>::is_noexcept)
0243   {
0244     return query_static_constexpr_member<T>::value();
0245   }
0246 
0247   template <typename T>
0248   static constexpr
0249   typename traits::static_query<T, untracked_t>::result_type
0250   static_query(
0251       enable_if_t<
0252         !query_static_constexpr_member<T>::is_valid
0253       >* = 0,
0254       enable_if_t<
0255         !query_member<T>::is_valid
0256       >* = 0,
0257       enable_if_t<
0258         traits::static_query<T, untracked_t>::is_valid
0259       >* = 0) noexcept
0260   {
0261     return traits::static_query<T, untracked_t>::value();
0262   }
0263 
0264   template <typename T>
0265   static constexpr
0266   typename traits::static_query<T, tracked_t>::result_type
0267   static_query(
0268       enable_if_t<
0269         !query_static_constexpr_member<T>::is_valid
0270       >* = 0,
0271       enable_if_t<
0272         !query_member<T>::is_valid
0273       >* = 0,
0274       enable_if_t<
0275         !traits::static_query<T, untracked_t>::is_valid
0276       >* = 0,
0277       enable_if_t<
0278         traits::static_query<T, tracked_t>::is_valid
0279       >* = 0) noexcept
0280   {
0281     return traits::static_query<T, tracked_t>::value();
0282   }
0283 
0284   template <typename E,
0285       typename T = decltype(outstanding_work_t::static_query<E>())>
0286   static constexpr const T static_query_v
0287     = outstanding_work_t::static_query<E>();
0288 #endif // defined(BOOST_ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
0289        //   && defined(BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
0290 
0291   friend constexpr bool operator==(
0292       const outstanding_work_t& a, const outstanding_work_t& b)
0293   {
0294     return a.value_ == b.value_;
0295   }
0296 
0297   friend constexpr bool operator!=(
0298       const outstanding_work_t& a, const outstanding_work_t& b)
0299   {
0300     return a.value_ != b.value_;
0301   }
0302 
0303   struct convertible_from_outstanding_work_t
0304   {
0305     constexpr convertible_from_outstanding_work_t(outstanding_work_t)
0306     {
0307     }
0308   };
0309 
0310   template <typename Executor>
0311   friend constexpr outstanding_work_t query(
0312       const Executor& ex, convertible_from_outstanding_work_t,
0313       enable_if_t<
0314         can_query<const Executor&, untracked_t>::value
0315       >* = 0)
0316 #if !defined(__clang__) // Clang crashes if noexcept is used here.
0317 #if defined(BOOST_ASIO_MSVC) // Visual C++ wants the type to be qualified.
0318     noexcept(is_nothrow_query<const Executor&,
0319         outstanding_work_t<>::untracked_t>::value)
0320 #else // defined(BOOST_ASIO_MSVC)
0321     noexcept(is_nothrow_query<const Executor&, untracked_t>::value)
0322 #endif // defined(BOOST_ASIO_MSVC)
0323 #endif // !defined(__clang__)
0324   {
0325     return boost::asio::query(ex, untracked_t());
0326   }
0327 
0328   template <typename Executor>
0329   friend constexpr outstanding_work_t query(
0330       const Executor& ex, convertible_from_outstanding_work_t,
0331       enable_if_t<
0332         !can_query<const Executor&, untracked_t>::value
0333       >* = 0,
0334       enable_if_t<
0335         can_query<const Executor&, tracked_t>::value
0336       >* = 0)
0337 #if !defined(__clang__) // Clang crashes if noexcept is used here.
0338 #if defined(BOOST_ASIO_MSVC) // Visual C++ wants the type to be qualified.
0339     noexcept(is_nothrow_query<const Executor&,
0340         outstanding_work_t<>::tracked_t>::value)
0341 #else // defined(BOOST_ASIO_MSVC)
0342     noexcept(is_nothrow_query<const Executor&, tracked_t>::value)
0343 #endif // defined(BOOST_ASIO_MSVC)
0344 #endif // !defined(__clang__)
0345   {
0346     return boost::asio::query(ex, tracked_t());
0347   }
0348 
0349   BOOST_ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(untracked_t, untracked);
0350   BOOST_ASIO_STATIC_CONSTEXPR_DEFAULT_INIT(tracked_t, tracked);
0351 
0352 private:
0353   int value_;
0354 };
0355 
0356 #if defined(BOOST_ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
0357   && defined(BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
0358 template <int I> template <typename E, typename T>
0359 const T outstanding_work_t<I>::static_query_v;
0360 #endif // defined(BOOST_ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
0361        //   && defined(BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
0362 
0363 template <int I>
0364 const typename outstanding_work_t<I>::untracked_t
0365 outstanding_work_t<I>::untracked;
0366 
0367 template <int I>
0368 const typename outstanding_work_t<I>::tracked_t
0369 outstanding_work_t<I>::tracked;
0370 
0371 namespace outstanding_work {
0372 
0373 template <int I = 0>
0374 struct untracked_t
0375 {
0376 #if defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES)
0377   template <typename T>
0378   static constexpr bool is_applicable_property_v = is_executor<T>::value;
0379 #endif // defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES)
0380 
0381   static constexpr bool is_requirable = true;
0382   static constexpr bool is_preferable = true;
0383   typedef outstanding_work_t<I> polymorphic_query_result_type;
0384 
0385   constexpr untracked_t()
0386   {
0387   }
0388 
0389   template <typename T>
0390   struct query_member :
0391     traits::query_member<
0392       typename outstanding_work_t<I>::template proxy<T>::type, untracked_t> {};
0393 
0394   template <typename T>
0395   struct query_static_constexpr_member :
0396     traits::query_static_constexpr_member<
0397       typename outstanding_work_t<I>::template static_proxy<T>::type,
0398         untracked_t> {};
0399 
0400 #if defined(BOOST_ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
0401   && defined(BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
0402   template <typename T>
0403   static constexpr
0404   typename query_static_constexpr_member<T>::result_type
0405   static_query()
0406     noexcept(query_static_constexpr_member<T>::is_noexcept)
0407   {
0408     return query_static_constexpr_member<T>::value();
0409   }
0410 
0411   template <typename T>
0412   static constexpr untracked_t static_query(
0413       enable_if_t<
0414         !query_static_constexpr_member<T>::is_valid
0415       >* = 0,
0416       enable_if_t<
0417         !query_member<T>::is_valid
0418       >* = 0,
0419       enable_if_t<
0420         !traits::query_free<T, untracked_t>::is_valid
0421       >* = 0,
0422       enable_if_t<
0423         !can_query<T, tracked_t<I>>::value
0424       >* = 0) noexcept
0425   {
0426     return untracked_t();
0427   }
0428 
0429   template <typename E, typename T = decltype(untracked_t::static_query<E>())>
0430   static constexpr const T static_query_v = untracked_t::static_query<E>();
0431 #endif // defined(BOOST_ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
0432        //   && defined(BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
0433 
0434   static constexpr outstanding_work_t<I> value()
0435   {
0436     return untracked_t();
0437   }
0438 
0439   friend constexpr bool operator==(const untracked_t&, const untracked_t&)
0440   {
0441     return true;
0442   }
0443 
0444   friend constexpr bool operator!=(const untracked_t&, const untracked_t&)
0445   {
0446     return false;
0447   }
0448 
0449   friend constexpr bool operator==(const untracked_t&, const tracked_t<I>&)
0450   {
0451     return false;
0452   }
0453 
0454   friend constexpr bool operator!=(const untracked_t&, const tracked_t<I>&)
0455   {
0456     return true;
0457   }
0458 };
0459 
0460 #if defined(BOOST_ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
0461   && defined(BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
0462 template <int I> template <typename E, typename T>
0463 const T untracked_t<I>::static_query_v;
0464 #endif // defined(BOOST_ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
0465        //   && defined(BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
0466 
0467 template <int I = 0>
0468 struct tracked_t
0469 {
0470 #if defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES)
0471   template <typename T>
0472   static constexpr bool is_applicable_property_v = is_executor<T>::value;
0473 #endif // defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES)
0474 
0475   static constexpr bool is_requirable = true;
0476   static constexpr bool is_preferable = true;
0477   typedef outstanding_work_t<I> polymorphic_query_result_type;
0478 
0479   constexpr tracked_t()
0480   {
0481   }
0482 
0483   template <typename T>
0484   struct query_member :
0485     traits::query_member<
0486       typename outstanding_work_t<I>::template proxy<T>::type, tracked_t> {};
0487 
0488   template <typename T>
0489   struct query_static_constexpr_member :
0490     traits::query_static_constexpr_member<
0491       typename outstanding_work_t<I>::template static_proxy<T>::type,
0492         tracked_t> {};
0493 
0494 #if defined(BOOST_ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
0495   && defined(BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
0496   template <typename T>
0497   static constexpr
0498   typename query_static_constexpr_member<T>::result_type
0499   static_query()
0500     noexcept(query_static_constexpr_member<T>::is_noexcept)
0501   {
0502     return query_static_constexpr_member<T>::value();
0503   }
0504 
0505   template <typename E, typename T = decltype(tracked_t::static_query<E>())>
0506   static constexpr const T static_query_v = tracked_t::static_query<E>();
0507 #endif // defined(BOOST_ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
0508        //   && defined(BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
0509 
0510   static constexpr outstanding_work_t<I> value()
0511   {
0512     return tracked_t();
0513   }
0514 
0515   friend constexpr bool operator==(const tracked_t&, const tracked_t&)
0516   {
0517     return true;
0518   }
0519 
0520   friend constexpr bool operator!=(const tracked_t&, const tracked_t&)
0521   {
0522     return false;
0523   }
0524 
0525   friend constexpr bool operator==(const tracked_t&, const untracked_t<I>&)
0526   {
0527     return false;
0528   }
0529 
0530   friend constexpr bool operator!=(const tracked_t&, const untracked_t<I>&)
0531   {
0532     return true;
0533   }
0534 };
0535 
0536 #if defined(BOOST_ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
0537   && defined(BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
0538 template <int I> template <typename E, typename T>
0539 const T tracked_t<I>::static_query_v;
0540 #endif // defined(BOOST_ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
0541        //   && defined(BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
0542 
0543 } // namespace outstanding_work
0544 } // namespace detail
0545 
0546 typedef detail::outstanding_work_t<> outstanding_work_t;
0547 
0548 BOOST_ASIO_INLINE_VARIABLE constexpr outstanding_work_t outstanding_work;
0549 
0550 } // namespace execution
0551 
0552 #if !defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES)
0553 
0554 template <typename T>
0555 struct is_applicable_property<T, execution::outstanding_work_t>
0556   : integral_constant<bool, execution::is_executor<T>::value>
0557 {
0558 };
0559 
0560 template <typename T>
0561 struct is_applicable_property<T, execution::outstanding_work_t::untracked_t>
0562   : integral_constant<bool, execution::is_executor<T>::value>
0563 {
0564 };
0565 
0566 template <typename T>
0567 struct is_applicable_property<T, execution::outstanding_work_t::tracked_t>
0568   : integral_constant<bool, execution::is_executor<T>::value>
0569 {
0570 };
0571 
0572 #endif // !defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES)
0573 
0574 namespace traits {
0575 
0576 #if !defined(BOOST_ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
0577 
0578 template <typename T>
0579 struct query_free_default<T, execution::outstanding_work_t,
0580   enable_if_t<
0581     can_query<T, execution::outstanding_work_t::untracked_t>::value
0582   >>
0583 {
0584   static constexpr bool is_valid = true;
0585   static constexpr bool is_noexcept =
0586     is_nothrow_query<T, execution::outstanding_work_t::untracked_t>::value;
0587 
0588   typedef execution::outstanding_work_t result_type;
0589 };
0590 
0591 template <typename T>
0592 struct query_free_default<T, execution::outstanding_work_t,
0593   enable_if_t<
0594     !can_query<T, execution::outstanding_work_t::untracked_t>::value
0595       && can_query<T, execution::outstanding_work_t::tracked_t>::value
0596   >>
0597 {
0598   static constexpr bool is_valid = true;
0599   static constexpr bool is_noexcept =
0600     is_nothrow_query<T, execution::outstanding_work_t::tracked_t>::value;
0601 
0602   typedef execution::outstanding_work_t result_type;
0603 };
0604 
0605 #endif // !defined(BOOST_ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
0606 
0607 #if !defined(BOOST_ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT) \
0608   || !defined(BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
0609 
0610 template <typename T>
0611 struct static_query<T, execution::outstanding_work_t,
0612   enable_if_t<
0613     execution::detail::outstanding_work_t<0>::
0614       query_static_constexpr_member<T>::is_valid
0615   >>
0616 {
0617   static constexpr bool is_valid = true;
0618   static constexpr bool is_noexcept = true;
0619 
0620   typedef typename execution::detail::outstanding_work_t<0>::
0621     query_static_constexpr_member<T>::result_type result_type;
0622 
0623   static constexpr result_type value()
0624   {
0625     return execution::detail::outstanding_work_t<0>::
0626       query_static_constexpr_member<T>::value();
0627   }
0628 };
0629 
0630 template <typename T>
0631 struct static_query<T, execution::outstanding_work_t,
0632   enable_if_t<
0633     !execution::detail::outstanding_work_t<0>::
0634         query_static_constexpr_member<T>::is_valid
0635       && !execution::detail::outstanding_work_t<0>::
0636         query_member<T>::is_valid
0637       && traits::static_query<T,
0638         execution::outstanding_work_t::untracked_t>::is_valid
0639   >>
0640 {
0641   static constexpr bool is_valid = true;
0642   static constexpr bool is_noexcept = true;
0643 
0644   typedef typename traits::static_query<T,
0645     execution::outstanding_work_t::untracked_t>::result_type result_type;
0646 
0647   static constexpr result_type value()
0648   {
0649     return traits::static_query<T,
0650         execution::outstanding_work_t::untracked_t>::value();
0651   }
0652 };
0653 
0654 template <typename T>
0655 struct static_query<T, execution::outstanding_work_t,
0656   enable_if_t<
0657     !execution::detail::outstanding_work_t<0>::
0658         query_static_constexpr_member<T>::is_valid
0659       && !execution::detail::outstanding_work_t<0>::
0660         query_member<T>::is_valid
0661       && !traits::static_query<T,
0662         execution::outstanding_work_t::untracked_t>::is_valid
0663       && traits::static_query<T,
0664         execution::outstanding_work_t::tracked_t>::is_valid
0665   >>
0666 {
0667   static constexpr bool is_valid = true;
0668   static constexpr bool is_noexcept = true;
0669 
0670   typedef typename traits::static_query<T,
0671     execution::outstanding_work_t::tracked_t>::result_type result_type;
0672 
0673   static constexpr result_type value()
0674   {
0675     return traits::static_query<T,
0676         execution::outstanding_work_t::tracked_t>::value();
0677   }
0678 };
0679 
0680 template <typename T>
0681 struct static_query<T, execution::outstanding_work_t::untracked_t,
0682   enable_if_t<
0683     execution::detail::outstanding_work::untracked_t<0>::
0684       query_static_constexpr_member<T>::is_valid
0685   >>
0686 {
0687   static constexpr bool is_valid = true;
0688   static constexpr bool is_noexcept = true;
0689 
0690   typedef typename execution::detail::outstanding_work::untracked_t<0>::
0691     query_static_constexpr_member<T>::result_type result_type;
0692 
0693   static constexpr result_type value()
0694   {
0695     return execution::detail::outstanding_work::untracked_t<0>::
0696       query_static_constexpr_member<T>::value();
0697   }
0698 };
0699 
0700 template <typename T>
0701 struct static_query<T, execution::outstanding_work_t::untracked_t,
0702   enable_if_t<
0703     !execution::detail::outstanding_work::untracked_t<0>::
0704         query_static_constexpr_member<T>::is_valid
0705       && !execution::detail::outstanding_work::untracked_t<0>::
0706           query_member<T>::is_valid
0707       && !traits::query_free<T,
0708         execution::outstanding_work_t::untracked_t>::is_valid
0709       && !can_query<T, execution::outstanding_work_t::tracked_t>::value
0710   >>
0711 {
0712   static constexpr bool is_valid = true;
0713   static constexpr bool is_noexcept = true;
0714 
0715   typedef execution::outstanding_work_t::untracked_t result_type;
0716 
0717   static constexpr result_type value()
0718   {
0719     return result_type();
0720   }
0721 };
0722 
0723 template <typename T>
0724 struct static_query<T, execution::outstanding_work_t::tracked_t,
0725   enable_if_t<
0726     execution::detail::outstanding_work::tracked_t<0>::
0727       query_static_constexpr_member<T>::is_valid
0728   >>
0729 {
0730   static constexpr bool is_valid = true;
0731   static constexpr bool is_noexcept = true;
0732 
0733   typedef typename execution::detail::outstanding_work::tracked_t<0>::
0734     query_static_constexpr_member<T>::result_type result_type;
0735 
0736   static constexpr result_type value()
0737   {
0738     return execution::detail::outstanding_work::tracked_t<0>::
0739       query_static_constexpr_member<T>::value();
0740   }
0741 };
0742 
0743 #endif // !defined(BOOST_ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
0744        //   || !defined(BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)
0745 
0746 } // namespace traits
0747 
0748 #endif // defined(GENERATING_DOCUMENTATION)
0749 
0750 } // namespace asio
0751 } // namespace boost
0752 
0753 #include <boost/asio/detail/pop_options.hpp>
0754 
0755 #endif // BOOST_ASIO_EXECUTION_OUTSTANDING_WORK_HPP