|
valarray::sumpublic member function
T sum() const; Return sum of elements Returns the sum of all the elements in the valarray as if calculated by applying operator+= to a copy of one enelement and all the other elements in an unspecified order.The use of this member function requires that operator+= can be applied to T. ParametersnoneReturn valueThe sum of all the elements in the valarray.T is the template type of valarray (the elements' type). Example
Output:
See also
|