-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
This snippet demonstrates a workaround in when_all() unit tests that needs to be removed. The workaround is required because of issue #60.
Lines 265 to 280 in bc33a78
| async_run(d)( | |
| []() -> task<std::tuple<int, int, int>> { | |
| co_return co_await when_all( | |
| throws_exception("error_1"), | |
| throws_exception("error_2"), | |
| throws_exception("error_3")); | |
| }(), | |
| [](std::tuple<int, int, int>) {}, | |
| [&](std::exception_ptr ep) { | |
| try { | |
| std::rethrow_exception(ep); | |
| } catch (test_exception const& e) { | |
| caught_exception = true; | |
| error_msg = e.what(); | |
| } | |
| }); |
After there is a resolution for #60, we should remove the lambda wrappers for the desired API:
async_run(d)(
when_all(throws_exception("error_1"), throws_exception("error_2"), throws_exception("error_3")),
[](std::tuple<int, int, int>) {},
[&](std::exception_ptr ep) {
try {
std::rethrow_exception(ep);
} catch (test_exception const& e) {
caught_exception = true;
error_msg = e.what();
}
}); Metadata
Metadata
Assignees
Labels
No labels