cppassist  1.0.0.f4fab4f962ff
C++ sanctuary for small but powerful and frequently required, stand alone features.
Namespaces | Functions | Variables
parallelfor.inl File Reference
#include <thread>
Include dependency graph for parallelfor.inl:
This graph shows which files directly or indirectly include this file:

Namespaces

 cppassist
 

Functions

template<typename T >
void cppassist::forEach (T start, T end, typename identity< std::function< void(T)>>::type callback, bool parallelize=true)
 Call a function on each iteration of a loop. More...
 
template<typename T >
void cppassist::parallelFor (T start, T end, typename identity< std::function< void(T)>>::type callback)
 Call a function on each iteration of a loop (parallelized in threads) More...
 
template<typename T >
void cppassist::parallelFor (const std::vector< T > &elements, typename identity< std::function< void(const T &element)>>::type callback)
 Call a function on each item of a list (parallelized in threads) More...
 
template<typename T >
void cppassist::parallelFor (std::vector< T > &elements, typename identity< std::function< void(T &element)>>::type callback)
 Call a function on each item of a list (parallelized in threads) More...
 
template<typename T >
void cppassist::sequentialFor (T start, T end, typename identity< std::function< void(T)>>::type callback)
 Call a function on each iteration of a loop (sequential) More...
 
template<typename T >
void cppassist::sequentialFor (const std::vector< T > &elements, typename identity< std::function< void(const T &element)>>::type callback)
 Call a function on each item of a list (sequential) More...
 
template<typename T >
void cppassist::sequentialFor (std::vector< T > &elements, typename identity< std::function< void(T &element)>>::type callback)
 Call a function on each item of a list (sequential) More...
 

Variables

const auto cppassist::numberOfThreads = getNumberOfThreads()