2 // experimental/detached.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~~~~
5 // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com)
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)
11 #ifndef BOOST_ASIO_EXPERIMENTAL_DETACHED_HPP
12 #define BOOST_ASIO_EXPERIMENTAL_DETACHED_HPP
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18 #include <boost/asio/detail/config.hpp>
21 #include <boost/asio/detail/push_options.hpp>
25 namespace experimental {
27 /// Class used to specify that an asynchronous operation is detached.
30 * The detached_t class is used to indicate that an asynchronous operation is
31 * detached. That is, there is no completion handler waiting for the
32 * operation's result. A detached_t object may be passed as a handler to an
33 * asynchronous operation, typically using the special value
34 * @c boost::asio::experimental::detached. For example:
36 * @code my_socket.async_send(my_buffer, boost::asio::experimental::detached);
43 BOOST_ASIO_CONSTEXPR detached_t()
48 /// A special value, similar to std::nothrow.
50 * See the documentation for boost::asio::experimental::detached_t for a usage
53 #if defined(BOOST_ASIO_HAS_CONSTEXPR) || defined(GENERATING_DOCUMENTATION)
54 constexpr detached_t detached;
55 #elif defined(BOOST_ASIO_MSVC)
56 __declspec(selectany) detached_t detached;
59 } // namespace experimental
63 #include <boost/asio/detail/pop_options.hpp>
65 #include <boost/asio/experimental/impl/detached.hpp>
67 #endif // BOOST_ASIO_EXPERIMENTAL_DETACHED_HPP