Node:Comparisons, Next:Logical operations, Previous:Arithmetic operations, Up:Function objects
| equal_to |
Binary Predicate |
| not_equal_to |
Binary Predicate |
| greater |
Binary Predicate |
| less |
Binary Predicate |
| greater_equal |
Binary Predicate |
| less_equal |
Binary Predicate |
|
The library provides basic function object classes for all of the comparison operators in the language. |
templatestruct equal_to : binary_function { bool operator()(const T& x, const T& y) const { return x == y; } }; template struct not_equal_to : binary_function { bool operator()(const T& x, const T& y) const { return x != y; } }; template struct greater : binary_function { bool operator()(const T& x, const T& y) const { return x > y; } }; template struct less : binary_function { bool operator()(const T& x, const T& y) const { return x < y; } }; template struct greater_equal : binary_function { bool operator()(const T& x, const T& y) const { return x >= y; } }; template struct less_equal : binary_function { bool operator()(const T& x, const T& y) const { return x <= y; } };