Clementine
operation_state.hpp
1 //
2 // execution/operation_state.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2020 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 
11 #ifndef ASIO_EXECUTION_OPERATION_STATE_HPP
12 #define ASIO_EXECUTION_OPERATION_STATE_HPP
13 
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
15 # pragma once
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17 
18 #include "asio/detail/config.hpp"
19 #include "asio/detail/type_traits.hpp"
20 #include "asio/execution/start.hpp"
21 
22 #if defined(ASIO_HAS_DEDUCED_START_FREE_TRAIT) \
23  && defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
24 # define ASIO_HAS_DEDUCED_EXECUTION_IS_OPERATION_STATE_TRAIT 1
25 #endif // defined(ASIO_HAS_DEDUCED_START_FREE_TRAIT)
26  // && defined(ASIO_HAS_DEDUCED_START_MEMBER_TRAIT)
27 
28 #include "asio/detail/push_options.hpp"
29 
30 namespace asio {
31 namespace execution {
32 namespace detail {
33 
34 template <typename T>
36  integral_constant<bool,
37  is_destructible<T>::value
38  && is_object<T>::value
39  >
40 {
41 };
42 
43 } // namespace detail
44 
47 
52 template <typename T>
54 #if defined(GENERATING_DOCUMENTATION)
55  integral_constant<bool, automatically_determined>
56 #else // defined(GENERATING_DOCUMENTATION)
57  conditional<
58  can_start<typename add_lvalue_reference<T>::type>::value
59  && is_nothrow_start<typename add_lvalue_reference<T>::type>::value,
60  detail::is_operation_state_base<T>,
61  false_type
62  >::type
63 #endif // defined(GENERATING_DOCUMENTATION)
64 {
65 };
66 
67 #if defined(ASIO_HAS_VARIABLE_TEMPLATES)
68 
69 template <typename T>
70 ASIO_CONSTEXPR const bool is_operation_state_v =
72 
73 #endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
74 
75 #if defined(ASIO_HAS_CONCEPTS)
76 
77 template <typename T>
79 
80 #define ASIO_EXECUTION_OPERATION_STATE \
81  ::asio::execution::operation_state
82 
83 #else // defined(ASIO_HAS_CONCEPTS)
84 
85 #define ASIO_EXECUTION_OPERATION_STATE typename
86 
87 #endif // defined(ASIO_HAS_CONCEPTS)
88 
89 } // namespace execution
90 } // namespace asio
91 
92 #include "asio/detail/pop_options.hpp"
93 
94 #endif // ASIO_EXECUTION_OPERATION_STATE_HPP
The is_operation_state trait detects whether a type T satisfies the execution::operation_state concep...
Definition: operation_state.hpp:53
Definition: chrono.h:284
Definition: bulk_execute.cpp:26
Definition: operation_state.hpp:35
Definition: handler_work.hpp:37
Definition: any_io_executor.hpp:28