Add range-based when_all overloads and consolidate internals#231
Conversation
…ance#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)
📝 WalkthroughWalkthroughThe PR introduces range-based overloads for Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
An automated preview of the documentation is available at https://231.capy.prtest3.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-03-12 18:16:57 UTC |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
include/boost/capy/concept/io_awaitable.hpp (1)
125-136: Concept documentation is minimal compared toIoAwaitableabove.The
IoAwaitableRangeconcept definition is correct. However, the coding guidelines require comprehensive concept javadoc including@par Syntactic Requirements,@par Semantic Requirements,@par Conforming Signatures,@par Example, and@seesections. The existingIoAwaitableconcept (lines 21-114) demonstrates the expected level of detail.Consider expanding the documentation to match the project's established pattern, or at minimum adding an
@par Exampleand@seecross-reference:📝 Suggested documentation additions
/** Concept for ranges of I/O awaitables. A range satisfies `IoAwaitableRange` if it is a sized input range whose value type satisfies `@ref` IoAwaitable. `@tparam` R The range type. + + `@par` Syntactic Requirements + + `@li` `std::ranges::input_range<R>` is satisfied + `@li` `std::ranges::sized_range<R>` is satisfied + `@li` `IoAwaitable<std::ranges::range_value_t<R>>` is satisfied + + `@par` Example + + `@code` + template<IoAwaitableRange R> + task<void> run_all(R&& awaitables) + { + co_await when_all(std::forward<R>(awaitables)); + } + `@endcode` + + `@see` IoAwaitable, when_all, when_any */As per coding guidelines: "Concept javadoc should include
@parSyntactic Requirements with bulleted@lilist of every valid expression" and "Concept javadoc should include@parExample with a@codeblock."🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@include/boost/capy/concept/io_awaitable.hpp` around lines 125 - 136, The IoAwaitableRange concept lacks the comprehensive javadoc required by our guidelines; update the comment block for template<typename R> concept IoAwaitableRange to include `@par` Syntactic Requirements (enumerate valid expressions using std::ranges::input_range, std::ranges::sized_range, and IoAwaitable<std::ranges::range_value_t<R>>), `@par` Semantic Requirements (expected runtime/complexity/ownership guarantees), `@par` Conforming Signatures (signature of the concept and value_type relationship), an `@par` Example section with a `@code` block showing a minimal type that satisfies IoAwaitableRange, and a `@see` pointing to IoAwaitable to mirror the pattern used in the IoAwaitable documentation; keep the concept definition intact (IoAwaitableRange) and follow the same phrasing/style as the IoAwaitable comment above.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@include/boost/capy/concept/io_awaitable.hpp`:
- Around line 125-136: The IoAwaitableRange concept lacks the comprehensive
javadoc required by our guidelines; update the comment block for
template<typename R> concept IoAwaitableRange to include `@par` Syntactic
Requirements (enumerate valid expressions using std::ranges::input_range,
std::ranges::sized_range, and IoAwaitable<std::ranges::range_value_t<R>>), `@par`
Semantic Requirements (expected runtime/complexity/ownership guarantees), `@par`
Conforming Signatures (signature of the concept and value_type relationship), an
`@par` Example section with a `@code` block showing a minimal type that satisfies
IoAwaitableRange, and a `@see` pointing to IoAwaitable to mirror the pattern used
in the IoAwaitable documentation; keep the concept definition intact
(IoAwaitableRange) and follow the same phrasing/style as the IoAwaitable comment
above.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: dc554b09-891c-4012-843f-56634fdcac95
⛔ Files ignored due to path filters (1)
test/unit/when_all.cppis excluded by!**/test/**
📒 Files selected for processing (3)
include/boost/capy/concept/io_awaitable.hppinclude/boost/capy/when_all.hppinclude/boost/capy/when_any.hpp
💤 Files with no reviewable changes (1)
- include/boost/capy/when_any.hpp
|
GCOVR code coverage report https://231.capy.prtest3.cppalliance.org/gcovr/index.html Build time: 2026-03-12 18:33:54 UTC |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #231 +/- ##
===========================================
+ Coverage 92.38% 92.48% +0.09%
===========================================
Files 162 162
Lines 8854 8958 +104
===========================================
+ Hits 8180 8285 +105
+ Misses 674 673 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 7 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Closes #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.
Summary by CodeRabbit
New Features
when_allto support range-based collections of awaitables, enabling batch operations on vectors or ranges of async tasks.Refactor