std::transform
Template:cpp/algorithm/sidebar Template:ddcl list begin <tr class="t-dsc-header">
<td><algorithm>
<td></td> <td></td> </tr> <tr class="t-dcl ">
<td >OutputIterator transform( InputIterator first1, InputIterator1 last1,
<td > (1) </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl ">
<td >OutputIterator transform( InputIterator1 first1, InputIterator1 last1,
<td > (2) </td> <td class="t-dcl-nopad"> </td> </tr> Template:ddcl list end
Applies the given function to a range and stores the result in another range, beginning at d_first
. In the first version unary operation unary_op
is applied to the range, defined by [first1, last1)
. In the second version binary operation binary_op
is applied to pairs of elements from two ranges: one defined by [first1, last1)
and other beginning at first2
.
first1, last1 | - | the first range of elements to transform |
first2 | - | the beginning of the second range of elements to transform |
d_first | - | the beginning of the destination range |
unary_op | - | unary operation function object that will be applied. The signature of the function should be equivalent to the following: Ret fun(const Type &a); The signature does not need to have const &. |
binary_op | - | binary operation function object that will be applied. The signature of the function should be equivalent to the following: Ret fun(const Type1 &a, const Type2 &b); The signature does not need to have const &. |
output iterator to the element past the last element transformed.
This section is incomplete Reason: no eq fun |
This section is incomplete Reason: no example |
1) exactly Template:cpp applications of unary_op
2) exactly Template:cpp applications of binary_op