/usr/include/boost/asio/impl
NameSizeModeActions
awaitable.hpp117480644editdlrm
buffered_read_stream.hpp169250644editdlrm
buffered_write_stream.hpp164290644editdlrm
compose.hpp204610644editdlrm
connect.hpp322340644editdlrm
co_spawn.hpp88340644editdlrm
defer.hpp78030644editdlrm
detached.hpp33740644editdlrm
dispatch.hpp75670644editdlrm
error.ipp30700644editdlrm
execution_context.hpp32470644editdlrm
execution_context.ipp18010644editdlrm
executor.hpp68350644editdlrm
executor.ipp10020644editdlrm
handler_alloc_hook.ipp19840644editdlrm
io_context.hpp137280644editdlrm
io_context.ipp41080644editdlrm
multiple_exceptions.ipp12800644editdlrm
post.hpp77620644editdlrm
read.hpp451780644editdlrm
read_at.hpp283310644editdlrm
read_until.hpp1153350644editdlrm
redirect_error.hpp120150644editdlrm
serial_port_base.hpp13750644editdlrm
serial_port_base.ipp133270644editdlrm
spawn.hpp158540644editdlrm
src.hpp38330644editdlrm
system_context.hpp8750644editdlrm
system_context.ipp21090644editdlrm
system_executor.hpp63910644editdlrm
thread_pool.hpp108530644editdlrm
thread_pool.ipp31320644editdlrm
use_awaitable.hpp72440644editdlrm
use_future.hpp276100644editdlrm
write.hpp410760644editdlrm
write_at.hpp247320644editdlrm
Edit: /usr/include/boost/asio/impl/use_awaitable.hpp (7244B)
// // impl/use_awaitable.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2020 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_IMPL_USE_AWAITABLE_HPP #define BOOST_ASIO_IMPL_USE_AWAITABLE_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 awaitable_handler_base : public awaitable_thread { public: typedef void result_type; typedef awaitable awaitable_type; // Construct from the entry point of a new thread of execution. awaitable_handler_base(awaitable a, const Executor& ex) : awaitable_thread(std::move(a), ex) { } // Transfer ownership from another awaitable_thread. explicit awaitable_handler_base(awaitable_thread* h) : awaitable_thread(std::move(*h)) { } protected: awaitable_frame* frame() noexcept { return static_cast*>(this->top_of_stack_); } }; template class awaitable_handler; template class awaitable_handler : public awaitable_handler_base { public: using awaitable_handler_base::awaitable_handler_base; void operator()() { this->frame()->attach_thread(this); this->frame()->return_void(); this->frame()->pop_frame(); this->pump(); } }; template class awaitable_handler : public awaitable_handler_base { public: using awaitable_handler_base::awaitable_handler_base; void operator()(const boost::system::error_code& ec) { this->frame()->attach_thread(this); if (ec) this->frame()->set_error(ec); else this->frame()->return_void(); this->frame()->pop_frame(); this->pump(); } }; template class awaitable_handler : public awaitable_handler_base { public: using awaitable_handler_base::awaitable_handler_base; void operator()(std::exception_ptr ex) { this->frame()->attach_thread(this); if (ex) this->frame()->set_except(ex); else this->frame()->return_void(); this->frame()->pop_frame(); this->pump(); } }; template class awaitable_handler : public awaitable_handler_base { public: using awaitable_handler_base::awaitable_handler_base; template void operator()(Arg&& arg) { this->frame()->attach_thread(this); this->frame()->return_value(std::forward(arg)); this->frame()->pop_frame(); this->pump(); } }; template class awaitable_handler : public awaitable_handler_base { public: using awaitable_handler_base::awaitable_handler_base; template void operator()(const boost::system::error_code& ec, Arg&& arg) { this->frame()->attach_thread(this); if (ec) this->frame()->set_error(ec); else this->frame()->return_value(std::forward(arg)); this->frame()->pop_frame(); this->pump(); } }; template class awaitable_handler : public awaitable_handler_base { public: using awaitable_handler_base::awaitable_handler_base; template void operator()(std::exception_ptr ex, Arg&& arg) { this->frame()->attach_thread(this); if (ex) this->frame()->set_except(ex); else this->frame()->return_value(std::forward(arg)); this->frame()->pop_frame(); this->pump(); } }; template class awaitable_handler : public awaitable_handler_base> { public: using awaitable_handler_base>::awaitable_handler_base; template void operator()(Args&&... args) { this->frame()->attach_thread(this); this->frame()->return_values(std::forward(args)...); this->frame()->pop_frame(); this->pump(); } }; template class awaitable_handler : public awaitable_handler_base> { public: using awaitable_handler_base>::awaitable_handler_base; template void operator()(const boost::system::error_code& ec, Args&&... args) { this->frame()->attach_thread(this); if (ec) this->frame()->set_error(ec); else this->frame()->return_values(std::forward(args)...); this->frame()->pop_frame(); this->pump(); } }; template class awaitable_handler : public awaitable_handler_base> { public: using awaitable_handler_base>::awaitable_handler_base; template void operator()(std::exception_ptr ex, Args&&... args) { this->frame()->attach_thread(this); if (ex) this->frame()->set_except(ex); else this->frame()->return_values(std::forward(args)...); this->frame()->pop_frame(); this->pump(); } }; } // namespace detail #if !defined(GENERATING_DOCUMENTATION) template class async_result, R(Args...)> { public: typedef typename detail::awaitable_handler< Executor, typename decay::type...> handler_type; typedef typename handler_type::awaitable_type return_type; #if defined(_MSC_VER) template static T dummy_return() { return std::move(*static_cast(nullptr)); } template <> static void dummy_return() { } #endif // defined(_MSC_VER) template static return_type initiate(Initiation initiation, use_awaitable_t u, InitArgs... args) { (void)u; co_await [&](auto* frame) { BOOST_ASIO_HANDLER_LOCATION((u.file_name_, u.line_, u.function_name_)); handler_type handler(frame->detach_thread()); std::move(initiation)(std::move(handler), std::move(args)...); return static_cast(nullptr); }; for (;;) {} // Never reached. #if defined(_MSC_VER) co_return dummy_return(); #endif // defined(_MSC_VER) } }; #endif // !defined(GENERATING_DOCUMENTATION) } // namespace asio } // namespace boost #include #endif // BOOST_ASIO_IMPL_USE_AWAITABLE_HPP