valarray::size

size_t size() const;

The member function returns the number of elements in the array.