// // impl/deferred.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 ASIO_IMPL_DEFERRED_HPP #define ASIO_IMPL_DEFERRED_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include "asio/detail/push_options.hpp" namespace asio { #if !defined(GENERATING_DOCUMENTATION) template class async_result { public: template static deferred_async_operation initiate(Initiation&& initiation, deferred_t, InitArgs&&... args) { return deferred_async_operation( deferred_init_tag{}, static_cast(initiation), static_cast(args)...); } }; template class async_result { public: template static deferred_async_operation< deferred_signatures, Initiation, InitArgs...> initiate(Initiation&& initiation, deferred_t, InitArgs&&... args) { return deferred_async_operation< deferred_signatures, Initiation, InitArgs...>( deferred_init_tag{}, static_cast(initiation), static_cast(args)...); } }; template class async_result, Signature> { public: template static auto initiate(Initiation&& initiation, deferred_function token, InitArgs&&... init_args) -> decltype( deferred_sequence< deferred_async_operation< Signature, Initiation, InitArgs...>, Function>(deferred_init_tag{}, deferred_async_operation< Signature, Initiation, InitArgs...>( deferred_init_tag{}, static_cast(initiation), static_cast(init_args)...), static_cast(token.function_))) { return deferred_sequence< deferred_async_operation< Signature, Initiation, InitArgs...>, Function>(deferred_init_tag{}, deferred_async_operation< Signature, Initiation, InitArgs...>( deferred_init_tag{}, static_cast(initiation), static_cast(init_args)...), static_cast(token.function_)); } }; template class async_result, Signatures...> { public: template static auto initiate(Initiation&& initiation, deferred_function token, InitArgs&&... init_args) -> decltype( deferred_sequence< deferred_async_operation< deferred_signatures, Initiation, InitArgs...>, Function>(deferred_init_tag{}, deferred_async_operation< deferred_signatures, Initiation, InitArgs...>( deferred_init_tag{}, static_cast(initiation), static_cast(init_args)...), static_cast(token.function_))) { return deferred_sequence< deferred_async_operation< deferred_signatures, Initiation, InitArgs...>, Function>(deferred_init_tag{}, deferred_async_operation< deferred_signatures, Initiation, InitArgs...>( deferred_init_tag{}, static_cast(initiation), static_cast(init_args)...), static_cast(token.function_)); } }; template