// // detail/completion_payload_handler.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2024 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 BOOST_ASIO_DETAIL_COMPLETION_PAYLOAD_HANDLER_HPP #define BOOST_ASIO_DETAIL_COMPLETION_PAYLOAD_HANDLER_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include #include #include namespace boost { namespace asio { namespace detail { template class completion_payload_handler { public: completion_payload_handler(Payload&& p, Handler& h) : payload_(static_cast(p)), handler_(static_cast(h)) { } void operator()() { payload_.receive(handler_); } Handler& handler() { return handler_; } //private: Payload payload_; Handler handler_; }; } // namespace detail template