Skip to content

Commit 9e1b9a3

Browse files
committed
add the actual example code
1 parent c631878 commit 9e1b9a3

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

examples/when-all.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// examples/when-all.cpp -*-C++-*-
2+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3+
4+
#include <beman/execution/task.hpp>
5+
#include <beman/execution/execution.hpp>
6+
#include <concepts>
7+
8+
namespace ex = beman::execution;
9+
10+
// ----------------------------------------------------------------------------
11+
12+
int main() {
13+
ex::sync_wait([]()->ex::task<>{
14+
[[maybe_unused]] auto s = ex::when_all(
15+
ex::just(true),
16+
ex::just(10)
17+
);
18+
//static_assert(std::same_as<void, decltype(ex::get_completion_signatures(s, ex::empty_env{}))>);
19+
co_await std::move(s);
20+
co_return;
21+
}());
22+
}

0 commit comments

Comments
 (0)