cpp/algorithm/minmax

Returns the lowest and the greatest of the given values.

@1-2@ Returns references to the smaller and the greater of and.

@3-4@ Returns the smallest and the greatest of the values in initializer list.

The versions use  to compare the values, whereas the  versions use the given comparison function.

Return value
@1-2@ Returns the result of if  or if  is equivalent to. Returns the result of if.

@3-4@ A pair with the smallest value in as the first element and the greatest as the second. If several elements are equivalent to the smallest, the leftmost such element is returned. If several elements are equivalent to the largest, the rightmost such element is returned.

Complexity
@1-2@ Exactly one comparison

@3-4@ At most comparisons