Kiwaku 0.1-beta
Containers Well Made
 
Loading...
Searching...
No Matches

◆ for_each() [2/2]

template<typename Func , auto... S>
constexpr auto kwk::for_each ( Func &&  f,
shape< S... > const &  shp 
)
constexpr

Simple walkthrough over all possible indexes.

Applies the given function object f to every coordinates that are valid inside the given kwk::shape shp. Coordinates are iterated in order of the optimal memory access.

Parameters
fFunction object, to be applied to a variadic list of integral coordinates. The signature of the function should be equivalent to the following:
void f(std::integral auto... is);
shpA kwk::shape used as boundaries for the coordinates
Returns
The function object f which could have been modified.

Example