Browse Source

Math: C++14 constexpr in Unit.

pull/276/head
Vladimír Vondruš 12 years ago
parent
commit
b439eced74
  1. 8
      src/Magnum/Math/Unit.h

8
src/Magnum/Math/Unit.h

@ -93,7 +93,7 @@ template<template<class> class Derived, class T> class Unit {
}
/** @brief Add and assign value */
Unit<Derived, T>& operator+=(Unit<Derived, T> other) {
constexpr Unit<Derived, T>& operator+=(Unit<Derived, T> other) {
value += other.value;
return *this;
}
@ -104,7 +104,7 @@ template<template<class> class Derived, class T> class Unit {
}
/** @brief Subtract and assign value */
Unit<Derived, T>& operator-=(Unit<Derived, T> other) {
constexpr Unit<Derived, T>& operator-=(Unit<Derived, T> other) {
value -= other.value;
return *this;
}
@ -115,7 +115,7 @@ template<template<class> class Derived, class T> class Unit {
}
/** @brief Multiply with number and assign */
Unit<Derived, T>& operator*=(T number) {
constexpr Unit<Derived, T>& operator*=(T number) {
value *= number;
return *this;
}
@ -126,7 +126,7 @@ template<template<class> class Derived, class T> class Unit {
}
/** @brief Divide with number and assign */
Unit<Derived, T>& operator/=(T number) {
constexpr Unit<Derived, T>& operator/=(T number) {
value /= number;
return *this;
}

Loading…
Cancel
Save