Standard C++ Library Class Reference

vector<int> vec2;
vector<int> vecResult;
.
.
.
transform(vec1.begin(), vec1.end(), vec2.begin(), vec2.end(),
vecResult.begin(), times<int>());
After this call to transform, vecResult(n) will contain vec1(n) times vec2(n).
Warning
If your compiler does not support default template parameters, then you need to always supply the
Allocator template argument. For instance, you will have to write :
vector<int, allocator>
instead of :
vector<int>
See Also
binary_function, Function Objects