From 7204be47f2ccc7e2b6c75fa97d4b2e08dab5ff1e Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 27 Feb 2023 15:43:13 +0100 Subject: [PATCH] Base: add missing != operator to Quantity --- src/Base/Quantity.cpp | 5 +++++ src/Base/Quantity.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/Base/Quantity.cpp b/src/Base/Quantity.cpp index 24a6c6808e..0517a990e3 100644 --- a/src/Base/Quantity.cpp +++ b/src/Base/Quantity.cpp @@ -115,6 +115,11 @@ bool Quantity::operator ==(const Quantity& that) const return (this->_Value == that._Value) && (this->_Unit == that._Unit); } +bool Quantity::operator !=(const Quantity& that) const +{ + return !(*this == that); +} + bool Quantity::operator <(const Quantity& that) const { if (this->_Unit != that._Unit) diff --git a/src/Base/Quantity.h b/src/Base/Quantity.h index 5997910881..30ee1818d2 100644 --- a/src/Base/Quantity.h +++ b/src/Base/Quantity.h @@ -130,6 +130,7 @@ public: Quantity operator /(const Quantity &p) const; Quantity operator /(double p) const; bool operator ==(const Quantity&) const; + bool operator !=(const Quantity&) const; bool operator < (const Quantity&) const; bool operator > (const Quantity&) const; bool operator <= (const Quantity&) const;