57 virtual bool operator<(
const T &)
const = 0;
59 bool operator==(
const T &other)
const {
return !operator!=(other); }
61 bool operator!=(
const T &other)
const {
return operator<(other) || operator>(other); }
63 bool operator>(
const T &other)
const {
return other.operator<(*
dynamic_cast<const T *
>(
this)); }
65 bool operator<=(
const T &other)
const {
return !operator>(other); }
66 bool operator>=(
const T &other)
const {
return !(operator<(other)); }
68 OPERATOR(not_equal, NotEqual) {
return less(left, right) || greater(left, right); }
70 OPERATOR(less, Less) {
71 if (left != right && left && right)
return *left < *right;
75 OPERATOR(equal, Equal) {
return !not_equal(left, right); }
76 OPERATOR(greater, Greater) {
return less(right, left); }
77 OPERATOR(less_equal, LessEqual) {
return !greater(left, right); }
78 OPERATOR(greater_equal, GreaterEqual) {
return !less(left, right); }