hpx::wait_each_n#
Defined in header hpx/future.hpp.
See Public API for a list of names and headers that are part of the public HPX API.
See also:
-
template<typename F, typename Iterator>
void hpx::wait_each_n(F &&f, Iterator begin, std::size_t count)# The function wait_each is an operator allowing to join on the result of all given futures. It AND-composes all future objects given and returns after they finished executing. Additionally, the supplied function is called for each of the passed futures as soon as the future has become ready.
Note
This function consumes the futures as they are passed on to the supplied function. The callback should take one or two parameters, namely either a future to be processed or a type that std::size_t is implicitly convertible to as the first parameter and the future as the second parameter. The first parameter will correspond to the index of the current future in the collection.
- Parameters:
f – The function which will be called for each of the input futures once the future has become ready.
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.