std::valarray<T>::sum
Min standard notice:
Computes the sum of the elements.
# Declarations
T sum() const;
# Return value
The sum of the elements.
# Example
#include <iostream>
#include <valarray>
int main()
{
std::valarray<int> a = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
std::cout << a.sum() << '\n';
}