123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- #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:
-
- BOOST_ASIO_CONSTEXPR detached_t()
- {
- }
-
-
- template <typename InnerExecutor>
- struct executor_with_default : InnerExecutor
- {
-
- typedef detached_t default_completion_token_type;
-
- executor_with_default(const InnerExecutor& ex) BOOST_ASIO_NOEXCEPT
- : InnerExecutor(ex)
- {
- }
-
-
- template <typename OtherExecutor>
- executor_with_default(const OtherExecutor& ex,
- typename constraint<
- is_convertible<OtherExecutor, InnerExecutor>::value
- >::type = 0) BOOST_ASIO_NOEXCEPT
- : InnerExecutor(ex)
- {
- }
- };
-
-
- #if defined(BOOST_ASIO_HAS_ALIAS_TEMPLATES) \
- || defined(GENERATING_DOCUMENTATION)
- template <typename T>
- using as_default_on_t = typename T::template rebind_executor<
- executor_with_default<typename T::executor_type> >::other;
- #endif
-
-
-
- template <typename T>
- static typename decay<T>::type::template rebind_executor<
- executor_with_default<typename decay<T>::type::executor_type>
- >::other
- as_default_on(BOOST_ASIO_MOVE_ARG(T) object)
- {
- return typename decay<T>::type::template rebind_executor<
- executor_with_default<typename decay<T>::type::executor_type>
- >::other(BOOST_ASIO_MOVE_CAST(T)(object));
- }
- };
- #if defined(BOOST_ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
- constexpr detached_t detached;
- #elif defined(BOOST_ASIO_MSVC)
- __declspec(selectany) detached_t detached;
- #endif
- }
- }
- #include <boost/asio/detail/pop_options.hpp>
- #include <boost/asio/impl/detached.hpp>
- #endif
|