aui::impl::parallel::LambdaCapturer#
Distributes iterator range over machine's threads. I.e. range of 32 elements on a 4-core machine would be split by 4 pieces of 8 elements.
| Header: | #include <AUI/Traits/parallel.h> |
| CMake: | aui_link(my_target PUBLIC aui::core) |
Detailed Description#
Typical usage:
AVector<int> container = { ... };
aui::parallel(container.begin(),
container.end(),
[](const AVector<int>::iterator& begin,
const AVector<int>::iterator& end) {
for (auto it = begin; it != end; ++it) {
// *it
}
};
See also: AUI_PARALLEL_MP.