Function object for performing comparisons. Deduces the parameter types of the function call operator from the arguments (but not the return type).
std::ranges::less::operator()
template<class T,class U> constexprbool operator()( T&& t, U&& u)const; | | |
| | |
Given the expressionstd::forward<T>(t)<std::forward<U>(u) asexpr:
This overload participates in overload resolution only ifstd::totally_ordered_with<T, U> is satisfied.
If there exists an expressionexpr1 of typeT
and an expressionexpr2 ofU
, such that the comparison results ofexpr1 andexpr2 violatestrict total ordering (rules are defined below), the behavior is undefined.
The comparison results ofexpr1 andexpr2 follow strict total ordering only ifexactly one of the following expressions istrue:
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.