template <class InIter, class OutIter, class Func> OutIter transform(InIter start, InIter end, OutIter result, Func unaryfunc); template <class InIter1, class InIter2, class OutIter, class Func> OutIter transform(InIter1 start1, InIter1 end1, InIter2 start2, OutIter result, Func binaryfunc);
The transform( ) algorithm applies a function to a range of elements and stores the outcome in result. In the first form, the range is specified by start and end. The function to be applied is specified by unaryfunc. This function receives the value of an element in its parameter, and it must return its transformation.
In the second form, the transformation is applied using a binary operator function that receives the value of an element from the sequence to be transformed in its first parameter and the value of an element from the second sequence as its second parameter.
Both versions return an iterator to the end of the resulting sequence.