// // sleep.hpp // ~~~~~~~~~ // // Copyright (c) 2003-2023 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 SLEEP_HPP #define SLEEP_HPP #include #include #include #include #include void async_sleep_impl( asio::any_completion_handler handler, asio::any_io_executor ex, std::chrono::nanoseconds duration); template inline auto async_sleep(asio::any_io_executor ex, std::chrono::nanoseconds duration, CompletionToken&& token) -> decltype( asio::async_initiate( async_sleep_impl, token, std::move(ex), duration)) { return asio::async_initiate( async_sleep_impl, token, std::move(ex), duration); } #endif // SLEEP_HPP