Add modulo operators to StronglyTypedNumber

This commit is contained in:
Maxime Coste 2013-11-06 19:10:15 +00:00
parent 7495d04a47
commit f2a902f682

View File

@ -55,6 +55,12 @@ public:
constexpr RealType operator-() { return RealType(-m_value); } constexpr RealType operator-() { return RealType(-m_value); }
constexpr RealType operator%(RealType other) const
{ return RealType(m_value % other.m_value); }
constexpr RealType operator%=(RealType other)
{ m_value %= other.m_value; return static_cast<RealType&>(*this); }
constexpr bool operator==(RealType other) const constexpr bool operator==(RealType other) const
{ return m_value == other.m_value; } { return m_value == other.m_value; }