collectAll overloads

Synopses

Declared in <folly/fibers/WhenN.h>

Schedules several tasks and blocks until all of these tasks are completed. If any of the tasks throws an exception, this exception will be re‐thrown, but only when all the tasks are complete. If several tasks throw exceptions one of them will be re‐thrown.

template<class InputIterator>
std::vector<std::invoke_result_t<std::iterator_traits<InputIterator>::value_type>>
collectAll(
    InputIterator first,
    InputIterator last);

collectAll specialization for functions returning void

template<class InputIterator>
void
collectAll(
    InputIterator first,
    InputIterator last)
requires std::is_same<
        std::invoke_result_t<
            typename std::iterator_traits<InputIterator>::value_type>,
        void>::value;

Return Value

vector of values returned by tasks

Parameters

Name

Description

first

Range of tasks to be scheduled

last

End of the range of tasks to be scheduled

Created with MrDocs