1 #ifndef _OPERATORS_H_ 2 #define _OPERATORS_H_ 3 4 class Operators 5 { 6 public: 7 int value; Operators()8 Operators() { } Operators(int value)9 Operators(int value) { this->value = value; } ~Operators()10 virtual ~Operators() { } 11 Operators operator+(Operators f) { return Operators(this->value + f.value); } 12 Operators operator-(Operators f) { return Operators(this->value - f.value); } 13 Operators operator*(Operators f) { return Operators(this->value * f.value); } 14 Operators operator/(Operators f) { return Operators(this->value / f.value); } 15 bool operator<(Operators f) { return this->value < f.value; } 16 bool operator<=(Operators f) { return this->value <= f.value; } 17 bool operator==(Operators f) { return this->value == f.value; } 18 bool operator!=(Operators f) { return this->value != f.value; } 19 bool operator>(Operators f) { return this->value > f.value; } 20 bool operator>=(Operators f) { return this->value >= f.value; } 21 Operators operator>>(int v) { return Operators(this->value >> v); } 22 Operators operator<<(int v) { return Operators(this->value << v); } 23 Operators operator%(int v) { return Operators(this->value % v); } 24 }; 25 26 #endif 27