File indexing completed on 2025-01-30 09:33:44
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_ASIO_DETACHED_HPP
0012 #define BOOST_ASIO_DETACHED_HPP
0013
0014 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
0015 # pragma once
0016 #endif
0017
0018 #include <boost/asio/detail/config.hpp>
0019 #include <memory>
0020 #include <boost/asio/detail/type_traits.hpp>
0021
0022 #include <boost/asio/detail/push_options.hpp>
0023
0024 namespace boost {
0025 namespace asio {
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039 class detached_t
0040 {
0041 public:
0042
0043 constexpr detached_t()
0044 {
0045 }
0046
0047
0048
0049 template <typename InnerExecutor>
0050 struct executor_with_default : InnerExecutor
0051 {
0052
0053 typedef detached_t default_completion_token_type;
0054
0055
0056 executor_with_default(const InnerExecutor& ex) noexcept
0057 : InnerExecutor(ex)
0058 {
0059 }
0060
0061
0062
0063 template <typename OtherExecutor>
0064 executor_with_default(const OtherExecutor& ex,
0065 constraint_t<
0066 is_convertible<OtherExecutor, InnerExecutor>::value
0067 > = 0) noexcept
0068 : InnerExecutor(ex)
0069 {
0070 }
0071 };
0072
0073
0074
0075 template <typename T>
0076 using as_default_on_t = typename T::template rebind_executor<
0077 executor_with_default<typename T::executor_type>>::other;
0078
0079
0080
0081 template <typename T>
0082 static typename decay_t<T>::template rebind_executor<
0083 executor_with_default<typename decay_t<T>::executor_type>
0084 >::other
0085 as_default_on(T&& object)
0086 {
0087 return typename decay_t<T>::template rebind_executor<
0088 executor_with_default<typename decay_t<T>::executor_type>
0089 >::other(static_cast<T&&>(object));
0090 }
0091 };
0092
0093
0094
0095
0096
0097
0098 constexpr detached_t detached;
0099
0100 }
0101 }
0102
0103 #include <boost/asio/detail/pop_options.hpp>
0104
0105 #include <boost/asio/impl/detached.hpp>
0106
0107 #endif