38forEachBatch(std::ranges::forward_range
auto&& container, std::size_t batchSize,
auto&& fn)
40 ASSERT(batchSize > 0,
"Batch size must be greater than 0");
42 auto to = std::begin(container);
43 auto end = std::end(container);
49 while (to != end and cnt > 0) {
54 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:38