cpp/algorithm/ranges/minmax

Returns the smallest and the greatest of the given projected values.

@1@ Returns references to the smaller and the greater of and. @2@ Returns the smallest and the greatest of the values in the initializer list. @3@ Returns the smallest and the greatest of the values in the range.

Return value
@1@ if, according to their respective projected value,  is smaller than ; otherwise it returns.

@2-3@, where and  are respectively the smallest and largest values in , according to their projected value. If several values are equivalent to the smallest and largest, returns the leftmost smallest value, and the rightmost largest value. If the range is empty (as determined by ), the behavior is undefined.

Complexity
@1@ Exactly one comparison and two applications of the projection.

@2-3@ At most comparisons and twice as many applications of the projection.