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 SinglePassRange1,
13 class SinglePassRange2,
16 BinaryFunction for_each(const SinglePassRange1& rng1,
17 const SinglePassRange2& rng2,
21 class SinglePassRange1,
22 class SinglePassRange2,
25 BinaryFunction for_each(const SinglePassRange1& rng1,
26 SinglePassRange2& rng2,
30 class SinglePassRange1,
31 class SinglePassRange2,
34 BinaryFunction for_each(SinglePassRange1& rng1,
35 const SinglePassRange2& rng2,
39 class SinglePassRange1,
40 class SinglePassRange2,
43 BinaryFunction for_each(SinglePassRange1& rng1,
44 SinglePassRange2& rng2,
50 `for_each` traverses forward through `rng1` and `rng2` simultaneously.
51 For each iteration, the element `x` is used from `rng1` and the corresponding
52 element `y` is used from `rng2` to invoke `fn(x,y)`.
54 Iteration is stopped upon reaching the end of the shorter of `rng1`, or `rng2`.
55 It is safe to call this function with unequal length ranges.
59 Defined in the header file `boost/range/algorithm_ext/for_each.hpp`
61 [heading Requirements]
63 # `SinglePassRange1` is a model of the __single_pass_range__ Concept.
64 # `SinglePassRange2` is a model of the __single_pass_range__ Concept.
65 # `BinaryFunction` is a model of the `BinaryFunctionConcept`.
66 # `SinglePassRange1`'s value type is convertible to `BinaryFunction`'s first argument type.
67 # `SinglepassRange2`'s value type is convertible to `BinaryFunction`'s second argument type.
71 Linear. Exactly `min(distance(rng1), distance(rng2))` applications of `BinaryFunction`.