diff --git a/src/Magnum/Math/Unit.h b/src/Magnum/Math/Unit.h index 9b4803ed9..d63d4695d 100644 --- a/src/Magnum/Math/Unit.h +++ b/src/Magnum/Math/Unit.h @@ -93,7 +93,7 @@ template class Derived, class T> class Unit { } /** @brief Add and assign value */ - Unit& operator+=(Unit other) { + constexpr Unit& operator+=(Unit other) { value += other.value; return *this; } @@ -104,7 +104,7 @@ template class Derived, class T> class Unit { } /** @brief Subtract and assign value */ - Unit& operator-=(Unit other) { + constexpr Unit& operator-=(Unit other) { value -= other.value; return *this; } @@ -115,7 +115,7 @@ template class Derived, class T> class Unit { } /** @brief Multiply with number and assign */ - Unit& operator*=(T number) { + constexpr Unit& operator*=(T number) { value *= number; return *this; } @@ -126,7 +126,7 @@ template class Derived, class T> class Unit { } /** @brief Divide with number and assign */ - Unit& operator/=(T number) { + constexpr Unit& operator/=(T number) { value /= number; return *this; }