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

Function throwing_stacked

test/experimental/coro/exception.cpp:111–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111boost::asio::experimental::coro<int(int)> throwing_stacked(
112 boost::asio::any_io_executor exec, int &val,
113 bool &destroyed_inner, bool &destroyed)
114{
115 BOOST_ASIO_CHECK((co_await boost::asio::this_coro::throw_if_cancelled()));
116
117 on_scope_exit x = [&]() noexcept { destroyed = true; };
118 (void)x;
119
120 auto gen = throwing_generator(exec, val, destroyed_inner);
121 while (auto next = co_await gen) // 1, 2, 4, 8, ...
122 BOOST_ASIO_CHECK(42 ==(co_yield *next)); // offset is delayed by one cycle
123}
124
125boost::asio::awaitable<void> throwing_generator_stacked_test()
126{

Callers 1

Calls 1

throwing_generatorFunction · 0.85

Tested by

no test coverage detected