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

Function stack_accumulate

test/experimental/coro/stack_test.cpp:39–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39boost::asio::experimental::coro<int(int)>
40stack_accumulate(boost::asio::any_io_executor exec)
41{
42 auto gen = stack_generator(exec);
43 int offset = 0;
44 while (auto next = co_await gen) // 1, 2, 4, 8, ...
45 offset = co_yield *next + offset; // offset is delayed by one cycle
46}
47
48boost::asio::experimental::coro<int>
49main_stack_coro(boost::asio::io_context&, bool & done)

Callers 1

main_stack_coroFunction · 0.85

Calls 1

stack_generatorFunction · 0.85

Tested by

no test coverage detected