public member function
<valarray>
std::valarray::min
Return smallest value
If the valarray has a size of zero, the value returned is unspecified (depends on the particular library implementation).
T shall support being compared with operator<.
Parameters
noneReturn value
The smallest value in the valarray.T is the template argument of valarray (the value type).
Example
|
|
Output:
Complexity
Depends on library implementation (operations may be parallelized).Iterator validity
No changes: Valid iterators, references and sub-arrays keep their validity.Data races
Both the valarray and its elements are accessed.Exception safety
If comparing element values with operator< throws an exception, it causes undefined behavior.See also
- valarray::sum
- Return sum of elements (public member function)
- valarray::max
- Return greatest value (public member function)
- valarray operators
- Valarray operators (function)