Standard C++ Library Class Reference
Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
accumulate
Generalized Numeric Operation
Summary
Accumulate all elements within a range into a single value.
Contents
Synopsis●
Description●
Complexity●
Example●
Warnings●
Synopsis
#include <numeric>
template <class InputIterator, class T>
T accumulate (InputIterator first,
InputIterator last,
T init);
template <class InputIterator,
class T,
class BinaryOperation>
T accumulate (InputIterator first,
InputIterator last,
T init,
BinaryOperation binary_op);