diff options
Diffstat (limited to 'general')
| -rw-r--r-- | general/Flag.h | 19 | ||||
| -rw-r--r-- | general/Fraction.h | 16 |
2 files changed, 34 insertions, 1 deletions
diff --git a/general/Flag.h b/general/Flag.h index bb9548f3..55b3a73d 100644 --- a/general/Flag.h +++ b/general/Flag.h @@ -38,9 +38,26 @@ class Flag void set(const int flag, const int status); void setFlag(const int flag); void setStatus(const int status); - + int flag() const; int status() const; + + inline Flag& operator=(const Flag& rhs) + { + if (this == &rhs) + return *this; + m_flag = rhs.m_flag; + m_status = rhs.m_status; + return *this; + } + inline bool operator==(const Flag& rhs) const + { + return ((m_flag == rhs.m_flag) && (m_status == rhs.m_status)); + } + inline bool operator!=(const Flag& rhs) const + { + return !(*this == rhs); + } private: int m_flag; int m_status; diff --git a/general/Fraction.h b/general/Fraction.h index 99b6eeec..2c1dc663 100644 --- a/general/Fraction.h +++ b/general/Fraction.h @@ -62,6 +62,22 @@ class Fraction { return Fraction(m_numerator * rhs.m_numerator, m_denominator * rhs.m_denominator); } + inline Fraction& operator=(const Fraction& rhs) + { + if (this == &rhs) + return *this; + m_numerator = rhs.m_numerator; + m_denominator = rhs.m_denominator; + return *this; + } + inline bool operator==(const Fraction& rhs) const + { + return ((m_numerator == rhs.m_numerator) && (m_denominator == rhs.m_denominator)); + } + inline bool operator!=(const Fraction& rhs) const + { + return !(*this == rhs); + } private: int m_numerator; int m_denominator; |
