http://www.cplusplus.com/reference/functional/less/?kw=less
You were redirected to cplusplus.com/less || See search results for: "less"
class template
<functional>
std::less
template <class T> struct less;
Function object class for less-than inequality comparison
Binary function object class whose call returns whether the its first argument compares less than the second (as returned by operator <).
Generically, function objects are instances of a class with member function operator() defined. This member function allows the object to be used with the same syntax as a function call.
It is defined with the same behavior as:
- C++98
- C++11
| |
Objects of this class can be used on standard algorithms such as sort, merge or lower_bound.
Template parameters
T
Type of the arguments to compare by the functional call.
The type shall support the operation (operator<).
Member types
member type | definition | notes |
---|---|---|
first_argument_type | T | Type of the first argument in member operator() |
second_argument_type | T | Type of the second argument in member operator() |
result_type | bool | Type returned by member operator() |
Member functions
bool operator() (const T& x, const T& y)
Member function returning whether the first argument compares less than the second (x<y
).
Example
| |
Output:
foo includes bar. |
See also
Function object class for equality comparison (class template )
Function object class for non-equality comparison (class template )
Function object class for greater-than inequality comparison (class template )
Function object class for greater-than-or-equal-to comparison (class template )
Function object class for less-than-or-equal-to comparison (class template )