Compartilhar via


accumulate (STL/CLR)

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at accumulate (STL/CLR).

Computes the sum of all the elements in a specified range including some initial value by computing successive partial sums or computes the result of successive partial results similarly obtained from using a specified binary operation other than the sum.

Syntax

template<class _InIt, class _Ty> inline  
    _Ty accumulate(_InIt _First, _InIt _Last, _Ty _Val);  
template<class _InIt, class _Ty, class _Fn2> inline  
    _Ty accumulate(_InIt _First, _InIt _Last, _Ty _Val, _Fn2 _Func);  

Remarks

This function behaves the same as the STL numeric function accumulate. For more information, see accumulate.

Requirements

Header: <cliext/numeric>

Namespace: cliext

See Also

numeric (STL/CLR)