less<T>
 |
 |
| Category: functors |
Component type: type |
Description
Less<T> is a function object. Specifically, it is an
Adaptable Binary Predicate, which means it is a function
object that tests the truth or falsehood of some condition.
If f is an object of class
less<T> and x and y are objects of class T, then
f(x,y) returns true if x < y and false otherwise.
Example
Finds the first negative element in a list.
list<int> L;
...
list<int>::iterator first_negative =
find_if(L.begin(), L.end(), bind2nd(less<int>(), 0));
assert(first_negative == L.end() || *first_negative < 0);
Definition
Defined in the standard header functional, and in the nonstandard
backward-compatibility header function.h.
Template parameters
|
Parameter
|
Description
|
Default
|
|
T
|
The type of an ./usr/share/doc/stl-manual/html/iterators.gif 0100644 0000000 0000000 00000007205 07120014753 020121 0 ustar root root GIF87a & |