累加map中的元素
accumulate
函数模板:
- Returns the result of accumulating all the values in the range
[first,last)
to init
模板行为:
1 | template <class InputIterator, class T> |
初始值为init
,用它做累加或累减操作:
1 |
1 | // accumulate example |
让希望永驻
accumulate
函数模板:
[first,last)
to init模板行为:
1 | template <class InputIterator, class T> |
初始值为init
,用它做累加或累减操作:
1 | #include <functional> // minus函数用来做累积减 |
1 | // accumulate example |