2 // execution/scheduler.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~~
5 // Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com)
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)
11 #ifndef BOOST_ASIO_EXECUTION_SCHEDULER_HPP
12 #define BOOST_ASIO_EXECUTION_SCHEDULER_HPP
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18 #include <boost/asio/detail/config.hpp>
19 #include <boost/asio/detail/type_traits.hpp>
20 #include <boost/asio/execution/schedule.hpp>
21 #include <boost/asio/traits/equality_comparable.hpp>
23 #include <boost/asio/detail/push_options.hpp>
31 struct is_scheduler_base :
32 integral_constant<bool,
33 is_copy_constructible<typename remove_cvref<T>::type>::value
34 && traits::equality_comparable<typename remove_cvref<T>::type>::is_valid
41 /// The is_scheduler trait detects whether a type T satisfies the
42 /// execution::scheduler concept.
44 * Class template @c is_scheduler is a type trait that is derived from @c
45 * true_type if the type @c T meets the concept definition for a scheduler for
46 * error type @c E, otherwise @c false_type.
50 #if defined(GENERATING_DOCUMENTATION)
51 integral_constant<bool, automatically_determined>
52 #else // defined(GENERATING_DOCUMENTATION)
54 can_schedule<T>::value,
55 detail::is_scheduler_base<T>,
58 #endif // defined(GENERATING_DOCUMENTATION)
62 #if defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES)
65 BOOST_ASIO_CONSTEXPR const bool is_scheduler_v = is_scheduler<T>::value;
67 #endif // defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES)
69 #if defined(BOOST_ASIO_HAS_CONCEPTS)
72 BOOST_ASIO_CONCEPT scheduler = is_scheduler<T>::value;
74 #define BOOST_ASIO_EXECUTION_SCHEDULER ::boost::asio::execution::scheduler
76 #else // defined(BOOST_ASIO_HAS_CONCEPTS)
78 #define BOOST_ASIO_EXECUTION_SCHEDULER typename
80 #endif // defined(BOOST_ASIO_HAS_CONCEPTS)
82 } // namespace execution
86 #include <boost/asio/detail/pop_options.hpp>
88 #endif // BOOST_ASIO_EXECUTION_SCHEDULER_HPP