From b439eced748ec511fced947b162539f06fc8ba39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 29 May 2014 21:55:33 +0200 Subject: [PATCH] Math: C++14 constexpr in Unit. --- src/Magnum/Math/Unit.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; }