19forEachBatch(std::ranges::forward_range
auto&& container, std::size_t batchSize,
auto&& fn)
21 ASSERT(batchSize > 0,
"Batch size must be greater than 0");
23 auto to = std::begin(container);
24 auto end = std::end(container);
30 while (to != end and cnt > 0) {
35 std::invoke(fn, from, to);
void forEachBatch(std::ranges::forward_range auto &&container, std::size_t batchSize, auto &&fn)
Iterate over a container in batches.
Definition Batching.hpp:19