HPX - High Performance ParalleX

PrevUpHomeNext

Function template when_each_n

hpx::when_each_n

Synopsis

// In header: <hpx/lcos/when_each.hpp>


template<typename F, typename Iterator> 
  future< Iterator > when_each_n(F && f, Iterator begin, std::size_t count);

Description

The function when_each is a operator allowing to join on the results of all given futures. It AND-composes all future objects given and returns a new future object representing the event of all those futures having finished executing. It also calls the supplied callback for each of the futures which becomes ready.

[Note] Note

This function consumes the futures as they are passed on to the supplied function.

Parameters:

begin

The iterator pointing to the first element of a sequence of future or shared_future objects for which wait_each_n should wait.

count

The number of elements in the sequence starting at first.

f

The function which will be called for each of the input futures once the future has become ready.

Returns:

Returns a future holding the iterator pointing to the first element after the last one.


PrevUpHomeNext