Skip to content

Latest commit

 

History

History
52 lines (29 loc) · 1.14 KB

CppStdMultiplies.md

File metadata and controls

52 lines (29 loc) · 1.14 KB

 

 

 

 

 

 

std::multiplies is a functor that encapsulates operator*. The functor to perform a division on a range is std::divides.

 

 

 

 

 

Example

 


#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)); }