forked from boostorg/range
Boost.RangeEx merged into Boost.Range
[SVN r60897]
This commit is contained in:
40
doc/reference/algorithm/for_each.qbk
Normal file
40
doc/reference/algorithm/for_each.qbk
Normal file
@ -0,0 +1,40 @@
|
||||
[section:for_each for_each]
|
||||
|
||||
[heading 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);
|
||||
``
|
||||
|
||||
[heading Description]
|
||||
|
||||
`for_each` traverses forward through `rng` and for each element `x` it invokes `fun(x)`.
|
||||
|
||||
[heading Definition]
|
||||
|
||||
Defined in the header file `boost/range/algorithm/for_each.hpp`
|
||||
|
||||
[heading Requirements]
|
||||
|
||||
* `SinglePassRange` is a model of the __single_pass_range__ Concept.
|
||||
* `UnaryFunction` is a model of the `UnaryFunctionConcept`.
|
||||
* `UnaryFunction` does not apply any non-constant operation through its argument.
|
||||
* `SinglePassRange`'s value type is convertible to `UnaryFunction`'s argument type.
|
||||
|
||||
[heading Complexity]
|
||||
|
||||
Linear. Exactly `distance(rng)` applications of `UnaryFunction`.
|
||||
|
||||
[endsect]
|
||||
|
||||
|
Reference in New Issue
Block a user