Improved undo
This commit is contained in:
parent
7e69688ca6
commit
f606fc6fc1
12 changed files with 96 additions and 99 deletions
|
|
@ -5,10 +5,13 @@
|
|||
#include <poolstl.hpp>
|
||||
#endif
|
||||
|
||||
template <typename ContainerType> void parallel_loop_container(const ContainerType& c, std::function<void(const typename ContainerType::value_type&)> func) {
|
||||
template <typename ContainerType> void parallel_loop_container(const ContainerType& c, std::function<void(const typename ContainerType::value_type&)> func, bool forceSingleThread = false) {
|
||||
#ifdef __EMSCRIPTEN__
|
||||
std::for_each(c.begin(), c.end(), func);
|
||||
#else
|
||||
std::for_each(std::execution::par_unseq, c.begin(), c.end(), func);
|
||||
if(forceSingleThread)
|
||||
std::for_each(c.begin(), c.end(), func);
|
||||
else
|
||||
std::for_each(std::execution::par_unseq, c.begin(), c.end(), func);
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue