mirror of
https://github.com/Naios/continuable.git
synced 2025-12-08 01:36:46 +08:00
Document range_loop
This commit is contained in:
parent
20cd0191fc
commit
fa589a1e95
@ -103,6 +103,28 @@ inline auto loop_continue() noexcept {
|
||||
return empty_result{};
|
||||
}
|
||||
|
||||
/// Can be used to create an asynchronous loop over a specific range.
|
||||
///
|
||||
/// The callable will be called repeatedly with each with begin increased
|
||||
/// until end is reached.
|
||||
///
|
||||
/// ```cpp
|
||||
/// auto iterate_some() {
|
||||
/// // Iterate step from 0 to 9
|
||||
/// return range_loop([] (int step) {
|
||||
/// return do_something(i).then([] {
|
||||
/// // You don't have to return a result here
|
||||
/// });
|
||||
/// }, 0, 10);
|
||||
/// }
|
||||
/// ```
|
||||
///
|
||||
/// \param callable The callable type which must return a cti::continuable_base
|
||||
/// which then resolves to a cti::result of arbitrary values.
|
||||
///
|
||||
/// \param begin The iterator to iterate over
|
||||
///
|
||||
/// \param end The iterator to iterate until
|
||||
///
|
||||
/// \since 4.0.0
|
||||
///
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user