minmax
Compares two input parameters and returns them as a pair, in order of least to greatest.
template<class Type>
pair<const Type&, const Type&>
minmax(
const Type& _Left,
const Type& _Right
);
template<class Type, class BinaryPredicate>
pair<const Type&, const Type&>
minmax(
const Type& _Left,
const Type& _Right,
BinaryPredicate _Comp
);
Parameters
_Left
The first of the two objects being compared._Right
The second of the two objects being compared._Comp
A binary predicate used to compare the two objects.
Property Value/Return Value
Returns a pair of objects, in order of least to greatest.
Remarks
The first template function returns pair<const Type&, const Type&>(_Right, _Left) if _Right < _Left. Otherwise it returns pair<const Type&, const Type&>(_Left, _Right).
The second member function returns a pair whose first element is the leftmost element of init that compares no larger than any other element, and whose second element is the rightmost element of _Init that compares no smaller than any other element.
The remaining template functions behave the same, except that they replace operator<(X, Y) with _Comp(X, Y).
The function performs exactly one comparison.
Requirements
Header: <algorithm>
Namespace: std