2 Copyright 2010 Neil Groves
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 [section:for_each for_each]
12 class SinglePassRange,
15 UnaryFunction for_each(SinglePassRange& rng, UnaryFunction fun);
18 class SinglePassRange,
21 UnaryFunction for_each(const SinglePassRange& rng, UnaryFunction fun);
26 `for_each` traverses forward through `rng` and for each element `x` it invokes `fun(x)`.
30 Defined in the header file `boost/range/algorithm/for_each.hpp`
32 [heading Requirements]
34 * `SinglePassRange` is a model of the __single_pass_range__ Concept.
35 * `UnaryFunction` is a model of the `UnaryFunctionConcept`.
36 * `UnaryFunction` does not apply any non-constant operation through its argument.
37 * `SinglePassRange`'s value type is convertible to `UnaryFunction`'s argument type.
41 Linear. Exactly `distance(rng)` applications of `UnaryFunction`.