libcoro  1.0
Coroutine support library for C++20
Classes | Public Member Functions | List of all members
coro::when_each< T > Class Template Reference

Process all futures in order of completion. More...

#include <future_list.h>

Classes

class  iterator
 iterator for when_each - it always return awaitable reference (future) More...
 

Public Member Functions

iterator begin ()
 retrieve iterator More...
 
iterator end ()
 retrieve end iterator More...
 
 when_each (std::initializer_list< pointer_wrapper< T > > lst)
 construct using initializer list More...
 
template<container_type Container>
 when_each (Container &cont)
 construct using a container More...
 
template<iterator_type Iter>
 when_each (Iter from, Iter to)
 construct using iterator pair More...
 

Detailed Description

template<typename T>
class coro::when_each< T >

Process all futures in order of completion.

for (auto fut: when_each({f1,f2,f3,f4}) {
auto result = co_await fut;
//use result
}
when_each(std::initializer_list< pointer_wrapper< T > > lst)
construct using initializer list
Definition: future_list.h:269
Template Parameters
Ttype of future object (example when_each<future<int> >)

Definition at line 176 of file future_list.h.


The documentation for this class was generated from the following file: