CPP STL - shivamvats/notes GitHub Wiki
-
accumulate: Templated function that can also be passed an operator.:
#include <numeric> // accumulate #include <functional> //multiplies int sum = std::accumulate(values.begin(), values.end(), 0); int product = std::accumulate( values.begin(), valued.end, 1, std::multiplies<int>());