From 371adc63f91efa9a2f997dbf897efa7643dcde99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 2 Aug 2015 18:33:52 +0200 Subject: [PATCH] MSVC 2015 compatibility: the issues with {} are eternal. Aargh. --- src/Magnum/Math/Angle.h | 12 ++++++++---- src/Magnum/Math/DualComplex.h | 6 ++++-- src/Magnum/Math/DualQuaternion.h | 6 ++++-- src/Magnum/Math/Matrix.h | 9 ++++++--- src/Magnum/Math/Matrix3.h | 9 ++++++--- src/Magnum/Math/Matrix4.h | 9 ++++++--- src/Magnum/Math/Range.h | 18 ++++++++++++------ src/Magnum/Math/RectangularMatrix.h | 6 ++++-- src/Magnum/Math/Vector2.h | 6 ++++-- src/Magnum/Math/Vector3.h | 6 ++++-- src/Magnum/Math/Vector4.h | 6 ++++-- 11 files changed, 62 insertions(+), 31 deletions(-) diff --git a/src/Magnum/Math/Angle.h b/src/Magnum/Math/Angle.h index 46459023d..021900922 100644 --- a/src/Magnum/Math/Angle.h +++ b/src/Magnum/Math/Angle.h @@ -124,10 +124,12 @@ std::sin(Float(Rad(b)); // required explicit conversion hints to user template class Deg: public Unit { public: /** @brief Construct zero angle */ - constexpr /*implicit*/ Deg(ZeroInitT = ZeroInit): Unit{ZeroInit} {} + /* MSVC 2015 can't handle {} here */ + constexpr /*implicit*/ Deg(ZeroInitT = ZeroInit): Unit(ZeroInit) {} /** @brief Construct without initializing the contents */ - explicit Deg(NoInitT): Unit{NoInit} {} + /* MSVC 2015 can't handle {} here */ + explicit Deg(NoInitT): Unit(NoInit) {} /** @brief Explicit constructor from unitless type */ constexpr explicit Deg(T value): Unit(value) {} @@ -185,10 +187,12 @@ See @ref Deg for more information. template class Rad: public Unit { public: /** @brief Default constructor */ - constexpr /*implicit*/ Rad(ZeroInitT = ZeroInit): Unit{ZeroInit} {} + /* MSVC 2015 can't handle {} here */ + constexpr /*implicit*/ Rad(ZeroInitT = ZeroInit): Unit(ZeroInit) {} /** @brief Construct without initializing the contents */ - explicit Rad(NoInitT): Unit{NoInit} {} + /* MSVC 2015 can't handle {} here */ + explicit Rad(NoInitT): Unit(NoInit) {} /** @brief Construct from unitless type */ constexpr explicit Rad(T value): Unit(value) {} diff --git a/src/Magnum/Math/DualComplex.h b/src/Magnum/Math/DualComplex.h index 282766785..12ee6e1fa 100644 --- a/src/Magnum/Math/DualComplex.h +++ b/src/Magnum/Math/DualComplex.h @@ -113,7 +113,8 @@ template class DualComplex: public Dual> { constexpr explicit DualComplex(ZeroInitT) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - : Dual>{Complex{ZeroInit}, Complex{ZeroInit}} + /* MSVC 2015 can't handle {} here */ + : Dual>(Complex{ZeroInit}, Complex{ZeroInit}) #endif {} @@ -121,7 +122,8 @@ template class DualComplex: public Dual> { explicit DualComplex(NoInitT) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - : Dual>{NoInit} + /* MSVC 2015 can't handle {} here */ + : Dual>(NoInit) #endif {} diff --git a/src/Magnum/Math/DualQuaternion.h b/src/Magnum/Math/DualQuaternion.h index ccebf2dbe..2e8b52143 100644 --- a/src/Magnum/Math/DualQuaternion.h +++ b/src/Magnum/Math/DualQuaternion.h @@ -120,7 +120,8 @@ template class DualQuaternion: public Dual> { constexpr explicit DualQuaternion(ZeroInitT) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - : Dual>{Quaternion{ZeroInit}, Quaternion{ZeroInit}} + /* MSVC 2015 can't handle {} here */ + : Dual>(Quaternion{ZeroInit}, Quaternion{ZeroInit}) #endif {} @@ -128,7 +129,8 @@ template class DualQuaternion: public Dual> { explicit DualQuaternion(NoInitT) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - : Dual>{NoInit} + /* MSVC 2015 can't handle {} here */ + : Dual>(NoInit) #endif {} diff --git a/src/Magnum/Math/Matrix.h b/src/Magnum/Math/Matrix.h index 884b69534..c11af3489 100644 --- a/src/Magnum/Math/Matrix.h +++ b/src/Magnum/Math/Matrix.h @@ -86,7 +86,8 @@ template class Matrix: public RectangularMatrix{typename Implementation::GenerateSequence::Type(), Vector(value)} + /* MSVC 2015 can't handle {} here */ + : RectangularMatrix(typename Implementation::GenerateSequence::Type(), Vector(value)) #endif {} @@ -94,7 +95,8 @@ template class Matrix: public RectangularMatrix{ZeroInit} + /* MSVC 2015 can't handle {} here */ + : RectangularMatrix(ZeroInit) #endif {} @@ -102,7 +104,8 @@ template class Matrix: public RectangularMatrix{NoInit} + /* MSVC 2015 can't handle {} here */ + : RectangularMatrix(NoInit) #endif {} diff --git a/src/Magnum/Math/Matrix3.h b/src/Magnum/Math/Matrix3.h index b7fe84e36..d39ccfc2a 100644 --- a/src/Magnum/Math/Matrix3.h +++ b/src/Magnum/Math/Matrix3.h @@ -162,7 +162,8 @@ template class Matrix3: public Matrix3x3 { constexpr /*implicit*/ Matrix3(IdentityInitT = IdentityInit, T value = T{1}) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - : Matrix3x3{IdentityInit, value} + /* MSVC 2015 can't handle {} here */ + : Matrix3x3(IdentityInit, value) #endif {} @@ -170,7 +171,8 @@ template class Matrix3: public Matrix3x3 { constexpr explicit Matrix3(ZeroInitT) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - : Matrix3x3{ZeroInit} + /* MSVC 2015 can't handle {} here */ + : Matrix3x3(ZeroInit) #endif {} @@ -178,7 +180,8 @@ template class Matrix3: public Matrix3x3 { constexpr explicit Matrix3(NoInitT) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - : Matrix3x3{NoInit} + /* MSVC 2015 can't handle {} here */ + : Matrix3x3(NoInit) #endif {} diff --git a/src/Magnum/Math/Matrix4.h b/src/Magnum/Math/Matrix4.h index 3a91cfdeb..1734ebc31 100644 --- a/src/Magnum/Math/Matrix4.h +++ b/src/Magnum/Math/Matrix4.h @@ -258,7 +258,8 @@ template class Matrix4: public Matrix4x4 { constexpr /*implicit*/ Matrix4(IdentityInitT = IdentityInit, T value = T{1}) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - : Matrix4x4{IdentityInit, value} + /* MSVC 2015 can't handle {} here */ + : Matrix4x4(IdentityInit, value) #endif {} @@ -266,7 +267,8 @@ template class Matrix4: public Matrix4x4 { constexpr explicit Matrix4(ZeroInitT) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - : Matrix4x4{ZeroInit} + /* MSVC 2015 can't handle {} here */ + : Matrix4x4(ZeroInit) #endif {} @@ -274,7 +276,8 @@ template class Matrix4: public Matrix4x4 { constexpr explicit Matrix4(NoInitT) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - : Matrix4x4{NoInit} + /* MSVC 2015 can't handle {} here */ + : Matrix4x4(NoInit) #endif {} diff --git a/src/Magnum/Math/Range.h b/src/Magnum/Math/Range.h index 4e07d462d..28b8f7c41 100644 --- a/src/Magnum/Math/Range.h +++ b/src/Magnum/Math/Range.h @@ -225,7 +225,8 @@ template class Range2D: public Range<2, T> { constexpr /*implicit*/ Range2D(ZeroInitT = ZeroInit) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - : Range<2, T>{ZeroInit} + /* MSVC 2015 can't handle {} here */ + : Range<2, T>(ZeroInit) #endif {} @@ -233,7 +234,8 @@ template class Range2D: public Range<2, T> { explicit Range2D(NoInitT) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - : Range<2, T>{NoInit} + /* MSVC 2015 can't handle {} here */ + : Range<2, T>(NoInit) #endif {} @@ -252,7 +254,8 @@ template class Range2D: public Range<2, T> { */ template::from(std::declval()))> constexpr explicit Range2D(const U& other) #ifndef DOXYGEN_GENERATING_OUTPUT - : Range<2, T>{Implementation::RangeConverter<2, T, U>::from(other)} + /* MSVC 2015 can't handle {} here */ + : Range<2, T>(Implementation::RangeConverter<2, T, U>::from(other)) #endif {} @@ -349,7 +352,8 @@ template class Range3D: public Range<3, T> { constexpr /*implicit*/ Range3D(ZeroInitT = ZeroInit) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - : Range<3, T>{ZeroInit} + /* MSVC 2015 can't handle {} here */ + : Range<3, T>(ZeroInit) #endif {} @@ -357,7 +361,8 @@ template class Range3D: public Range<3, T> { explicit Range3D(NoInitT) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - : Range<3, T>{NoInit} + /* MSVC 2015 can't handle {} here */ + : Range<3, T>(NoInit) #endif {} @@ -376,7 +381,8 @@ template class Range3D: public Range<3, T> { */ template::from(std::declval()))> constexpr explicit Range3D(const U& other) #ifndef DOXYGEN_GENERATING_OUTPUT - : Range<3, T>{Implementation::RangeConverter<3, T, U>::from(other)} + /* MSVC 2015 can't handle {} here */ + : Range<3, T>(Implementation::RangeConverter<3, T, U>::from(other)) #endif {} diff --git a/src/Magnum/Math/RectangularMatrix.h b/src/Magnum/Math/RectangularMatrix.h index a8814b781..abc5c9ae1 100644 --- a/src/Magnum/Math/RectangularMatrix.h +++ b/src/Magnum/Math/RectangularMatrix.h @@ -111,7 +111,8 @@ template class RectangularMatrix { constexpr /*implicit*/ RectangularMatrix(ZeroInitT = ZeroInit) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - : RectangularMatrix{typename Implementation::GenerateSequence::Type{}, ZeroInit} + /* MSVC 2015 can't handle {} here */ + : RectangularMatrix(typename Implementation::GenerateSequence::Type{}, ZeroInit) #endif {} @@ -119,7 +120,8 @@ template class RectangularMatrix { explicit RectangularMatrix(NoInitT) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - : RectangularMatrix{typename Implementation::GenerateSequence::Type{}, NoInit} + /* MSVC 2015 can't handle {} here */ + : RectangularMatrix(typename Implementation::GenerateSequence::Type{}, NoInit) #endif {} diff --git a/src/Magnum/Math/Vector2.h b/src/Magnum/Math/Vector2.h index 48be7dde9..009abd4b2 100644 --- a/src/Magnum/Math/Vector2.h +++ b/src/Magnum/Math/Vector2.h @@ -115,7 +115,8 @@ template class Vector2: public Vector<2, T> { constexpr /*implicit*/ Vector2(ZeroInitT = ZeroInit) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - : Vector<2, T>{ZeroInit} + /* MSVC 2015 can't handle {} here */ + : Vector<2, T>(ZeroInit) #endif {} @@ -123,7 +124,8 @@ template class Vector2: public Vector<2, T> { explicit Vector2(NoInitT) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - : Vector<2, T>{NoInit} + /* MSVC 2015 can't handle {} here */ + : Vector<2, T>(NoInit) #endif {} diff --git a/src/Magnum/Math/Vector3.h b/src/Magnum/Math/Vector3.h index 5ff986974..a2b98981c 100644 --- a/src/Magnum/Math/Vector3.h +++ b/src/Magnum/Math/Vector3.h @@ -137,7 +137,8 @@ template class Vector3: public Vector<3, T> { constexpr /*implicit*/ Vector3(ZeroInitT = ZeroInit) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - : Vector<3, T>{ZeroInit} + /* MSVC 2015 can't handle {} here */ + : Vector<3, T>(ZeroInit) #endif {} @@ -145,7 +146,8 @@ template class Vector3: public Vector<3, T> { explicit Vector3(NoInitT) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - : Vector<3, T>{NoInit} + /* MSVC 2015 can't handle {} here */ + : Vector<3, T>(NoInit) #endif {} diff --git a/src/Magnum/Math/Vector4.h b/src/Magnum/Math/Vector4.h index 6e3fa0ddc..8ba3d8d26 100644 --- a/src/Magnum/Math/Vector4.h +++ b/src/Magnum/Math/Vector4.h @@ -63,7 +63,8 @@ template class Vector4: public Vector<4, T> { constexpr /*implicit*/ Vector4(ZeroInitT = ZeroInit) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - : Vector<4, T>{ZeroInit} + /* MSVC 2015 can't handle {} here */ + : Vector<4, T>(ZeroInit) #endif {} @@ -71,7 +72,8 @@ template class Vector4: public Vector<4, T> { explicit Vector4(NoInitT) /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT - : Vector<4, T>{NoInit} + /* MSVC 2015 can't handle {} here */ + : Vector<4, T>(NoInit) #endif {}