// // execution/executor.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #ifndef BOOST_ASIO_EXECUTION_EXECUTOR_HPP #define BOOST_ASIO_EXECUTION_EXECUTOR_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include #include #include #include #include #if defined(BOOST_ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT) \ && defined(BOOST_ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT) # define BOOST_ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT 1 #endif // defined(BOOST_ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT) // && defined(BOOST_ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT) #include namespace boost { namespace asio { namespace execution { namespace detail { template struct is_executor_of_impl : false_type { }; template struct is_executor_of_impl, F>::is_valid >, void_t< result_of_t&()> >, enable_if_t< is_constructible, F>::value >, enable_if_t< is_move_constructible>::value >, enable_if_t< is_nothrow_copy_constructible::value >, enable_if_t< is_nothrow_destructible::value >, enable_if_t< traits::equality_comparable::is_valid >, enable_if_t< traits::equality_comparable::is_noexcept >> : true_type { }; } // namespace detail /// The is_executor trait detects whether a type T satisfies the /// execution::executor concept. /** * Class template @c is_executor is a UnaryTypeTrait that is derived from @c * true_type if the type @c T meets the concept definition for an executor, * otherwise @c false_type. */ template struct is_executor : #if defined(GENERATING_DOCUMENTATION) integral_constant #else // defined(GENERATING_DOCUMENTATION) detail::is_executor_of_impl #endif // defined(GENERATING_DOCUMENTATION) { }; #if defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES) template constexpr const bool is_executor_v = is_executor::value; #endif // defined(BOOST_ASIO_HAS_VARIABLE_TEMPLATES) #if defined(BOOST_ASIO_HAS_CONCEPTS) template BOOST_ASIO_CONCEPT executor = is_executor::value; #define BOOST_ASIO_EXECUTION_EXECUTOR ::boost::asio::execution::executor #else // defined(BOOST_ASIO_HAS_CONCEPTS) #define BOOST_ASIO_EXECUTION_EXECUTOR typename #endif // defined(BOOST_ASIO_HAS_CONCEPTS) } // namespace execution } // namespace asio } // namespace boost #include #endif // BOOST_ASIO_EXECUTION_EXECUTOR_HPP