Added negation

This commit is contained in:
Pascal Serrarens 2023-12-07 10:51:20 +01:00
parent bd04285d48
commit 254bb27f53
2 changed files with 4 additions and 2 deletions

View File

@ -10,6 +10,7 @@ public:
inline Range16 operator-(Range16 a);
inline Range16 operator+(Range16 a);
inline Range16 operator-();
inline bool operator==(Range16 a);
inline bool operator!=(Range16 a);

View File

@ -26,10 +26,11 @@ Range16::Range16(short s) {
}
Range16 Range16::operator-(Range16 a) { this->range - a.range; };
Range16 Range16::operator+(Range16 a) { this->range + a.range; };
bool Range16::operator==(Range16 a) { return (this->range == a.range); }
Range16 Range16::operator-() { -this->range; }
bool Range16::operator==(Range16 a) { this->range == a.range; }
bool Range16::operator!=(Range16 a) { return (this->range != a.range); }
bool Range16::operator<(Range16 a) { return (this->range < a.range); }