Min and Max
You can determine the minimum, the maximum and the minimum and maximum pair of a range with the algorithms std::min_element
, std::max_element
and std::minmax_element
. Each algorithm can be configured with a binary predicate.
Returns the minimum element of the range:
Returns the maximum element of the range:
Returns the pair std::min_element
and std::max_element
of the range: