absl::c_for_each

Container-based version of the <algorithm> std::for_each() function to apply a function to a container's elements.

Synopsis

Declared in <absl/algorithm/container.h>

template<
    typename C,
    typename Function>
constexpr
std::decay_t<Function>
c_for_each(
    C&& c,
    Function&& f);

Return Value

A copy of f after it has been applied to every element.

Parameters

NameDescription
cThe container whose elements to visit.
fThe function applied to each element.