, ,
: std::transform - , . ,
template<class InputIterator, class OutputIterator, class Functor>
OutputIterator
transform(InputIterator begin, InputIterator end, OutputIterator out, Functor f);
InputIterator, OutputIterator Functor . :
int increment(int);
int array[] = { 0, 1, 2, 3, 4 };
transform(std::begin(array), std::end(array), std::begin(array), increment);
InputIterator OutputIterator int*, Functor - int(*)(int), , , . , transform
template<typename InputIterator, typename OutputIterator, typename Functor>
OutputIterator
transform(InputIterator begin, InputIterator end, OutputIterator out, Functor f);
where the keyword typenamedescribes in more detail the nature of the template parameters: they are types of any nature.
source
share