parallel_for_each Template Function

Summary

Parallel variant of std::for_each.

Header

#include "tbb/parallel_for_each.h"

Syntax

template<typename InputIterator, typename Func> 
void parallel_for_each (InputIterator first, InputIterator last, 
                        const Func& f
                        [, task_group_context& group]);

Description

A parallel_for_each(first,last,f)applies f to the result of dereferencing every iterator in the range [first,last), possibly in parallel. It is provided for PPL compatibility and equivalent to parallel_do(first,last,f) without "feeder" functionality.

If the group argument is specified, the algorithm's tasks are executed in this group. By default the algorithm is executed in a bound group of its own.