std::for_each
The behavior of this template function is equivalent to:
template <class InputIterator, class Function>
Function for_each (InputIterator first, InputIterator last, Function fn);
Apply function to range
Applies function fn to each of the elements in the range [first,last)
.The behavior of this template function is equivalent to:
|
|
Parameters
-
first, last
-
Input iterators to the initial and final positions in a sequence. The range used is
[first,last)
, which contains all the elements between first and last, including the element pointed by first but not the element pointed by last.
fn
-
Unary function that accepts an element in the range as argument.
This can either be a function pointer or a move constructible function object.
Its return value, if any, is ignored.
Applies a specified function object to each element in a forward order within a range and returns the function object.