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

◆ for_each() [1/2]

template<typename Func , concepts::container C0, concepts::container... Cs>
constexpr auto kwk::for_each ( Func &&  f,
C0 &&  c0,
Cs &&...  cs 
)
constexpr

Simple walkthrough over all elements of a container.

Applies the given function object f to every elements of a given kwk::container. Elements are iterated in order of the optimal memory access.

Parameters
fFunction object, to be applied to an element of c. The signature of the function should be equivalent to the following:
void f(T&& v);
with T convertible to the container's value_type.
cA kwk::container on which elements f will be applied.
Returns
The function object f which could have been modified.

Example