MCPcopy Create free account
hub / github.com/boostorg/asio / async_wait_twice

Function async_wait_twice

example/cpp14/deferred/deferred_3.cpp:17–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15
16template <typename CompletionToken>
17auto async_wait_twice(boost::asio::steady_timer& timer, CompletionToken&& token)
18{
19 return timer.async_wait(
20 deferred(
21 [&](boost::system::error_code ec)
22 {
23 std::cout << "first timer wait finished: " << ec.message() << "\n";
24 timer.expires_after(std::chrono::seconds(1));
25 return timer.async_wait(deferred);
26 }
27 )
28 )(
29 std::forward<CompletionToken>(token)
30 );
31}
32
33int main()
34{

Callers 1

mainFunction · 0.70

Calls 2

async_waitMethod · 0.45
expires_afterMethod · 0.45

Tested by

no test coverage detected