libcoro  1.0
Coroutine support library for C++20

◆ aggregator() [1/4]

template<typename T , coro_allocator Alloc = std_allocator>
generator<T, Alloc> coro::aggregator ( Alloc &  ,
std::vector< generator< T > >  gens 
)

Construct generator which aggregates results of multiple generators.

Aggregator is generator which aggregates results of multiple generators. The aggregated generators can be both synchronous and asynchronous. Note that it isn't a good idea to mix both types in the single aggregator.

For synchronous generators, results are interleaved evenly. If used with asynchronous generators, results are in order of finished generation

Template Parameters
Tsubject of generation
Allocallocator for the generator (there is also version without allocator)
Parameters
genslist of generators to aggregate
Returns
instance of aggregator

disarm all futures

Definition at line 39 of file aggregator.h.

+ Here is the caller graph for this function: