Template Function quickpool::parallel_for_each

Function Documentation

template<typename Items, typename UnaryFunction>
inline void quickpool::parallel_for_each(Items &items, UnaryFunction &&f)

computes a iterator-based parallel for loop.

Waits until all tasks have finished, unless called from a thread that didn’t create the pool. If this is taken into account, parallel loops can be nested.

Parameters
  • items – an object allowing for std::begin() and std::end().

  • f – function to be applied as f(*it) for the iterator in the range [begin, end) (the ‘loop body’).