File tree Expand file tree Collapse file tree
actions/install-dependencies Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 shell : bash
88 run : |
99 sudo apt-get update
10- sudo apt-get install -y libgmock-dev libgtest-dev valgrind llvm gcovr graphviz
10+ sudo apt-get install -y libgtest-dev valgrind llvm gcovr graphviz
Original file line number Diff line number Diff line change 1616 build :
1717 name : Build and analyze
1818 runs-on : ubuntu-latest
19- env :
20- BUILD_WRAPPER_OUT_DIR : build_wrapper_output_directory
2119 permissions :
2220 contents : read
2321 steps :
7169 uses : codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
7270 with :
7371 token : ${{ secrets.CODECOV_TOKEN }}
74- file : build/coverage/coverage.lcov
72+ files : build/coverage/coverage.lcov
Original file line number Diff line number Diff line change 1717
1818#include < coroutine>
1919#include < exception>
20+ #include < functional>
2021#include < iterator>
2122#include < memory>
2223#include < type_traits>
2324#include < utility>
2425
2526#include " detail.h"
2627#include " exceptions.h"
28+ #include " task.h"
2729
2830namespace wwa ::coro {
2931
@@ -601,6 +603,18 @@ class [[nodiscard]] async_generator {
601603 {}
602604};
603605
606+ template <typename AsyncGenerator, typename Callable>
607+ task<void > async_for_each (AsyncGenerator gen, Callable callable)
608+ {
609+ auto it = co_await gen.begin ();
610+ auto end = gen.end ();
611+
612+ while (it != end) {
613+ std::invoke (std::forward<Callable>(callable), *it);
614+ co_await ++it;
615+ }
616+ }
617+
604618/* *
605619 * @example async_generator.cpp
606620 * Example of using an asynchronous generator.
You can’t perform that action at this time.
0 commit comments