Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
for_each
Prototype

template<
    class SinglePassRange,
    class UnaryFunction
    >
UnaryFunction for_each(SinglePassRange& rng, UnaryFunction fun);

template<
    class SinglePassRange,
    class UnaryFunction
    >
UnaryFunction for_each(const SinglePassRange& rng, UnaryFunction fun);

Description

for_each traverses forward through rng and for each element x it invokes fun(x).

Definition

Defined in the header file boost/range/algorithm/for_each.hpp

Requirements
Complexity

Linear. Exactly distance(rng) applications of UnaryFunction.


PrevUpHomeNext