diff --git a/src/Magnum/Math/Unit.h b/src/Magnum/Math/Unit.h index 4ec7f10f7..fbfe3a43b 100644 --- a/src/Magnum/Math/Unit.h +++ b/src/Magnum/Math/Unit.h @@ -46,20 +46,20 @@ template class Derived, class T> class Unit { typedef T Type; /**< @brief Underlying data type */ /** @brief Default constructor */ - constexpr /*implicit*/ Unit(): value(T(0)) {} + constexpr /*implicit*/ Unit(): _value(T(0)) {} /** @brief Explicit conversion from unitless type */ - constexpr explicit Unit(T value): value(value) {} + constexpr explicit Unit(T value): _value(value) {} /** @brief Construct from another underlying type */ - template constexpr explicit Unit(Unit value): value(T(value.value)) {} + template constexpr explicit Unit(Unit value): _value(T(value._value)) {} /** @brief Explicit conversion to underlying type */ - constexpr explicit operator T() const { return value; } + constexpr explicit operator T() const { return _value; } /** @brief Equality comparison */ constexpr bool operator==(Unit other) const { - return TypeTraits::equals(value, other.value); + return TypeTraits::equals(_value, other._value); } /** @brief Non-equality comparison */ @@ -69,12 +69,12 @@ template class Derived, class T> class Unit { /** @brief Less than comparison */ constexpr bool operator<(Unit other) const { - return value < other.value; + return _value < other._value; } /** @brief Greater than comparison */ constexpr bool operator>(Unit other) const { - return value > other.value; + return _value > other._value; } /** @brief Less than or equal comparison */ @@ -89,60 +89,60 @@ template class Derived, class T> class Unit { /** @brief Negated value */ constexpr Unit operator-() const { - return Unit(-value); + return Unit(-_value); } /** @brief Add and assign value */ Unit& operator+=(Unit other) { - value += other.value; + _value += other._value; return *this; } /** @brief Add value */ constexpr Unit operator+(Unit other) const { - return Unit(value + other.value); + return Unit(_value + other._value); } /** @brief Subtract and assign value */ Unit& operator-=(Unit other) { - value -= other.value; + _value -= other._value; return *this; } /** @brief Subtract value */ constexpr Unit operator-(Unit other) const { - return Unit(value - other.value); + return Unit(_value - other._value); } /** @brief Multiply with number and assign */ Unit& operator*=(T number) { - value *= number; + _value *= number; return *this; } /** @brief Multiply with number */ constexpr Unit operator*(T number) const { - return Unit(value*number); + return Unit(_value*number); } /** @brief Divide with number and assign */ Unit& operator/=(T number) { - value /= number; + _value /= number; return *this; } /** @brief Divide with number */ constexpr Unit operator/(T number) const { - return Unit(value/number); + return Unit(_value/number); } /** @brief Ratio of two values */ constexpr T operator/(Unit other) const { - return value/other.value; + return _value/other._value; } private: - T value; + T _value; }; /** @relates Unit