| 37 | } |
| 38 | |
| 39 | boost::asio::experimental::coro<int(int)> |
| 40 | stack_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 | |
| 48 | boost::asio::experimental::coro<int> |
| 49 | main_stack_coro(boost::asio::io_context&, bool & done) |
no test coverage detected