// // append.hpp // ~~~~~~~~~~ // // Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #ifndef ACTIV_BOOST_ASIO_APPEND_HPP #define ACTIV_BOOST_ASIO_APPEND_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include #if (defined(ACTIV_BOOST_ASIO_HAS_STD_TUPLE) \ && defined(ACTIV_BOOST_ASIO_HAS_VARIADIC_TEMPLATES)) \ || defined(GENERATING_DOCUMENTATION) #include #include #include namespace Boost { namespace asio { /// Completion token type used to specify that the completion handler /// arguments should be passed additional values after the results of the /// operation. template class append_t { public: /// Constructor. template ACTIV_BOOST_ASIO_CONSTEXPR explicit append_t( ACTIV_BOOST_ASIO_MOVE_ARG(T) completion_token, ACTIV_BOOST_ASIO_MOVE_ARG(V)... values) : token_(ACTIV_BOOST_ASIO_MOVE_CAST(T)(completion_token)), values_(ACTIV_BOOST_ASIO_MOVE_CAST(V)(values)...) { } //private: CompletionToken token_; std::tuple values_; }; /// Completion token type used to specify that the completion handler /// arguments should be passed additional values after the results of the /// operation. template ACTIV_BOOST_ASIO_NODISCARD inline ACTIV_BOOST_ASIO_CONSTEXPR append_t< typename decay::type, typename decay::type...> append(ACTIV_BOOST_ASIO_MOVE_ARG(CompletionToken) completion_token, ACTIV_BOOST_ASIO_MOVE_ARG(Values)... values) { return append_t< typename decay::type, typename decay::type...>( ACTIV_BOOST_ASIO_MOVE_CAST(CompletionToken)(completion_token), ACTIV_BOOST_ASIO_MOVE_CAST(Values)(values)...); } } // namespace asio } // namespace Boost #include #include #endif // (defined(ACTIV_BOOST_ASIO_HAS_STD_TUPLE) // && defined(ACTIV_BOOST_ASIO_HAS_VARIADIC_TEMPLATES)) // || defined(GENERATING_DOCUMENTATION) #endif // ACTIV_BOOST_ASIO_APPEND_HPP