Skip to content

Commit 4a56392

Browse files
committed
ci: fix minor issues in workflows
1 parent a82b7b3 commit 4a56392

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

.github/actions/install-dependencies/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ runs:
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

.github/workflows/sonarcloud.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ jobs:
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:
@@ -71,4 +69,4 @@ jobs:
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

src/async_generator.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@
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

2830
namespace 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.

0 commit comments

Comments
 (0)