std::multiplies is a functor that encapsulates operator*. The functor to perform a division on a range is std::divides.
#include <vector> #include <algorithm #include <numeric> //From http://www.richelbilderbeek.nl/CppTriple.htm void Triple(std::vector<int>& v) { std::transform(v.begin(),v.end(),v.begin(), std::bind2nd(std::multiplies<int>(),3)); }