GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||
GeezerVison is showing cplusplus.com — std::valarray::sum Reference
valarray
public member function
<valarray>
std::valarray::sumT sum() const; Return sum of elements
operator+= to a copy of one element and all the other elements, in an unspecified order.If the valarray has a size of zero, it causes undefined behavior. T shall support the calls to operator+=. ParametersnoneReturn valueThe sum of all the elements in the valarray.T is the template argument of valarray (the value type). Example
Output:
ComplexityDepends on library implementation (operations may be parallelized).Iterator validityNo changes: Valid iterators, references and sub-arrays keep their validity.Data racesBoth the valarray and its elements are accessed.Exception safetyIf applying operator+= to element values throws an exception, it causes undefined behavior.If the valarray has a size of zero, it causes undefined behavior. See also
Home page | Privacy policy
© cplusplus.com, 2000-2026 - All rights reserved - v3.3.4s Spotted an error? contact us | |||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |