123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- #ifndef BOOST_ASIO_DETACHED_HPP
- #define BOOST_ASIO_DETACHED_HPP
- #if defined(_MSC_VER) && (_MSC_VER >= 1200)
- # pragma once
- #endif
- #include <boost/asio/detail/config.hpp>
- #include <memory>
- #include <boost/asio/detail/type_traits.hpp>
- #include <boost/asio/detail/push_options.hpp>
- namespace boost {
- namespace asio {
- class detached_t
- {
- public:
-
- constexpr detached_t()
- {
- }
-
-
- template <typename InnerExecutor>
- struct executor_with_default : InnerExecutor
- {
-
- typedef detached_t default_completion_token_type;
-
- executor_with_default(const InnerExecutor& ex) noexcept
- : InnerExecutor(ex)
- {
- }
-
-
- template <typename OtherExecutor>
- executor_with_default(const OtherExecutor& ex,
- constraint_t<
- is_convertible<OtherExecutor, InnerExecutor>::value
- > = 0) noexcept
- : InnerExecutor(ex)
- {
- }
- };
-
-
- template <typename T>
- using as_default_on_t = typename T::template rebind_executor<
- executor_with_default<typename T::executor_type>>::other;
-
-
- template <typename T>
- static typename decay_t<T>::template rebind_executor<
- executor_with_default<typename decay_t<T>::executor_type>
- >::other
- as_default_on(T&& object)
- {
- return typename decay_t<T>::template rebind_executor<
- executor_with_default<typename decay_t<T>::executor_type>
- >::other(static_cast<T&&>(object));
- }
- };
- constexpr detached_t detached;
- }
- }
- #include <boost/asio/detail/pop_options.hpp>
- #include <boost/asio/impl/detached.hpp>
- #endif
|