Added Quantity::operator>(...).

This commit is contained in:
Eivind Kvedalen 2015-02-03 00:25:03 +01:00 committed by wmayer
parent 75dab66916
commit 8ec6b3493d
2 changed files with 9 additions and 0 deletions

View File

@ -79,6 +79,14 @@ bool Quantity::operator <(const Quantity& that) const
return (this->_Value < that._Value) ;
}
bool Quantity::operator >(const Quantity& that) const
{
if(this->_Unit != that._Unit)
throw Base::Exception("Quantity::operator >(): quantities need to have same unit to compare");
return (this->_Value > that._Value) ;
}
Quantity Quantity::operator *(const Quantity &p) const
{
return Quantity(this->_Value * p._Value,this->_Unit * p._Unit);

View File

@ -58,6 +58,7 @@ public:
Quantity operator /(const Quantity &p) const;
bool operator ==(const Quantity&) const;
bool operator < (const Quantity&) const;
bool operator > (const Quantity&) const;
Quantity& operator =(const Quantity&);
Quantity pow(const Quantity&)const;
//@}