#include class X { ... public: bool operator== (const X& x) const; bool operator< (const X& x) const; ... }; void foo() { using namespace std::rel_ops; // Получение доступа к !=, > и т. д. X x1, x2; ... if (x1 != x2) { ... } ... if (x1 > x2) { ... } ... }