File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed
actions/install-dependencies Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 7
7
shell : bash
8
8
run : |
9
9
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 16
16
build :
17
17
name : Build and analyze
18
18
runs-on : ubuntu-latest
19
- env :
20
- BUILD_WRAPPER_OUT_DIR : build_wrapper_output_directory
21
19
permissions :
22
20
contents : read
23
21
steps :
71
69
uses : codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
72
70
with :
73
71
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 17
17
18
18
#include < coroutine>
19
19
#include < exception>
20
+ #include < functional>
20
21
#include < iterator>
21
22
#include < memory>
22
23
#include < type_traits>
23
24
#include < utility>
24
25
25
26
#include " detail.h"
26
27
#include " exceptions.h"
28
+ #include " task.h"
27
29
28
30
namespace wwa ::coro {
29
31
@@ -601,6 +603,18 @@ class [[nodiscard]] async_generator {
601
603
{}
602
604
};
603
605
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
+
604
618
/* *
605
619
* @example async_generator.cpp
606
620
* Example of using an asynchronous generator.
You can’t perform that action at this time.
0 commit comments