Skip to content

Commit 19821af

Browse files
committed
Add range-based when_all overloads and consolidate internals (#205)
Add when_all(Range&&) overloads for homogeneous non-void and void awaitable ranges, matching the existing when_any range API. Extract when_all_core and unify runner types to reduce internal duplication. - Add IoAwaitableRange concept to concept/io_awaitable.hpp (shared with when_any) - Add when_all_homogeneous_state<T>, when_all_homogeneous_state<void>, and when_all_homogeneous_launcher<Range> for range support - Extract when_all_core from duplicated state members - Unify when_all_runner and when_all_homogeneous_runner into single when_all_runner<StateType> - Remove duplicate IoAwaitableRange definition from when_any.hpp - Add when_all_range_test suite (11 tests)
1 parent ecdb076 commit 19821af

4 files changed

Lines changed: 693 additions & 125 deletions

File tree

include/boost/capy/concept/io_awaitable.hpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <boost/capy/detail/config.hpp>
1414
#include <coroutine>
1515
#include <boost/capy/ex/io_env.hpp>
16+
#include <ranges>
1617

1718
namespace boost {
1819
namespace capy {
@@ -121,6 +122,19 @@ concept IoAwaitable =
121122
template<typename A>
122123
using awaitable_result_t = decltype(std::declval<std::decay_t<A>&>().await_resume());
123124

125+
/** Concept for ranges of I/O awaitables.
126+
127+
A range satisfies `IoAwaitableRange` if it is a sized input range
128+
whose value type satisfies @ref IoAwaitable.
129+
130+
@tparam R The range type.
131+
*/
132+
template<typename R>
133+
concept IoAwaitableRange =
134+
std::ranges::input_range<R> &&
135+
std::ranges::sized_range<R> &&
136+
IoAwaitable<std::ranges::range_value_t<R>>;
137+
124138
} // namespace capy
125139
} // namespace boost
126140

0 commit comments

Comments
 (0)