diff --git a/src/units.hh b/src/units.hh index a99957f9..99e2db45 100644 --- a/src/units.hh +++ b/src/units.hh @@ -53,12 +53,12 @@ public: RealType operator--(int) { RealType backup(static_cast(*this)); --m_value; return backup; } - constexpr RealType operator-() { return RealType(-m_value); } + constexpr RealType operator-() const { return RealType(-m_value); } constexpr RealType operator%(RealType other) const { return RealType(m_value % other.m_value); } - constexpr RealType operator%=(RealType other) + RealType& operator%=(RealType other) { m_value %= other.m_value; return static_cast(*this); } constexpr bool operator==(RealType other) const