diff --git a/src/Math/MathTypeTraits.h b/src/Math/MathTypeTraits.h index 88e60ae24..c1a989f8a 100644 --- a/src/Math/MathTypeTraits.h +++ b/src/Math/MathTypeTraits.h @@ -58,7 +58,7 @@ template struct MathTypeTraits { * inequal. Returns 1 for integer types and reasonably small value for * floating-point types. */ - constexpr inline static T epsilon(); + inline constexpr static T epsilon(); /** * @brief Fuzzy compare @@ -80,7 +80,7 @@ template struct MathTypeTraits { #ifndef DOXYGEN_GENERATING_OUTPUT template struct _MathTypeTraitsIntegral { - constexpr inline static T epsilon() { return 1; } + inline constexpr static T epsilon() { return 1; } inline constexpr static bool equals(T a, T b) { return a == b; @@ -109,10 +109,10 @@ template struct _MathTypeTraitsFloatingPoint { } }; template<> struct MathTypeTraits: public _MathTypeTraitsFloatingPoint { - constexpr inline static float epsilon() { return FLOAT_EQUALITY_PRECISION; } + inline constexpr static float epsilon() { return FLOAT_EQUALITY_PRECISION; } }; template<> struct MathTypeTraits: public _MathTypeTraitsFloatingPoint { - constexpr inline static double epsilon() { return DOUBLE_EQUALITY_PRECISION; } + inline constexpr static double epsilon() { return DOUBLE_EQUALITY_PRECISION; } }; #endif diff --git a/src/Math/Matrix4.h b/src/Math/Matrix4.h index 41a7f5d8c..87e585f92 100644 --- a/src/Math/Matrix4.h +++ b/src/Math/Matrix4.h @@ -36,7 +36,7 @@ template class Matrix4: public Matrix<4, T> { * @brief Translation matrix * @param vec Translation vector */ - static constexpr Matrix4 translation(const Vector3& vec) { + inline constexpr static Matrix4 translation(const Vector3& vec) { return Matrix4( /* Column-major! */ 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, @@ -49,7 +49,7 @@ template class Matrix4: public Matrix<4, T> { * @brief Scaling matrix * @param vec Scaling vector */ - static constexpr Matrix4 scaling(const Vector3& vec) { + inline constexpr static Matrix4 scaling(const Vector3& vec) { return Matrix4( /* Column-major! */ vec.x(), 0.0f, 0.0f, 0.0f, 0.0f, vec.y(), 0.0f, 0.0f, diff --git a/src/Math/Vector3.h b/src/Math/Vector3.h index f9e56a2e7..e9b691914 100644 --- a/src/Math/Vector3.h +++ b/src/Math/Vector3.h @@ -43,7 +43,7 @@ template class Vector3: public Vector<3, T> { * \begin{pmatrix}a_1b_2 - a_2b_1 \\ a_2b_0 - a_0b_2 \\ a_0b_1 - a_1b_0 \end{pmatrix} * @f] */ - constexpr static Vector3 cross(const Vector3& a, const Vector3& b) { + inline constexpr static Vector3 cross(const Vector3& a, const Vector3& b) { return Vector3(a[1]*b[2]-a[2]*b[1], a[2]*b[0]-a[0]*b[2], a[0]*b[1]-a[1]*b[0]); diff --git a/src/Set.h b/src/Set.h index b3178bb14..1645b06b2 100644 --- a/src/Set.h +++ b/src/Set.h @@ -49,18 +49,18 @@ template class Set { typedef U UnderlyingType; /**< @brief Underlying type of the enum */ /** @brief Create empty set */ - constexpr inline Set(): value() {} + inline constexpr Set(): value() {} /** @brief Create set from one value */ - constexpr inline Set(T value): value(static_cast(value)) {} + inline constexpr Set(T value): value(static_cast(value)) {} /** @brief Add value to the set */ - constexpr inline Set operator|(T other) const { + inline constexpr Set operator|(T other) const { return Set(value | static_cast(other)); } /** @brief Union of two sets */ - constexpr inline Set operator|(Set other) const { + inline constexpr Set operator|(Set other) const { return Set(value | other.value); } @@ -77,12 +77,12 @@ template class Set { } /** @brief Check if given value is in the set */ - constexpr inline T operator&(T other) const { + inline constexpr T operator&(T other) const { return static_cast(value & static_cast(other)); } /** @brief Intersection of two sets */ - constexpr inline Set operator&(Set other) const { + inline constexpr Set operator&(Set other) const { return Set(value & other.value); } @@ -93,12 +93,12 @@ template class Set { } /** @brief Value in underlying type */ - constexpr inline UnderlyingType toUnderlyingType() const { + inline constexpr UnderlyingType toUnderlyingType() const { return value; } private: - constexpr inline explicit Set(UnderlyingType type): value(type) {} + inline constexpr explicit Set(UnderlyingType type): value(type) {} UnderlyingType value; }; diff --git a/src/TypeTraits.h b/src/TypeTraits.h index 54ec54324..31dd42f93 100644 --- a/src/TypeTraits.h +++ b/src/TypeTraits.h @@ -42,7 +42,7 @@ template struct TypeTraits: public Math::MathTypeTraits { * * Returns e.g. Type::UnsignedInt for GLuint. */ - constexpr inline static Type type(); + inline constexpr static Type type(); /** * @brief OpenGL type ID for indices @@ -51,7 +51,7 @@ template struct TypeTraits: public Math::MathTypeTraits { * unsigned types). This function is not present for types unusable for * vertex indices, like GLfloat or GLint. */ - constexpr inline static Type indexType(); + inline constexpr static Type indexType(); /** * @brief OpenGL type ID for images @@ -60,7 +60,7 @@ template struct TypeTraits: public Math::MathTypeTraits { * GLubyte. This function is not present for types unusable for image data, * like GLdouble and Matrix3. */ - constexpr inline static AbstractImage::ComponentType imageType(); + inline constexpr static AbstractImage::ComponentType imageType(); /** * @brief Size of plain OpenGL type @@ -68,14 +68,14 @@ template struct TypeTraits: public Math::MathTypeTraits { * Returns sizeof(GLfloat) for GLfloat, but also sizeof(GLfloat) for * Vector3. See count(). */ - constexpr inline static size_t size(); + inline constexpr static size_t size(); /** * @brief Count of plain elements in this type * * Returns 1 for plain OpenGL types like GLint, but e.g. 3 for Vector3. */ - constexpr inline static size_t count(); + inline constexpr static size_t count(); }; #else template struct TypeTraits {};