Browse Source

MSVC 2015 compatibility: the issues with {} are eternal.

Aargh.
pull/107/head
Vladimír Vondruš 11 years ago
parent
commit
371adc63f9
  1. 12
      src/Magnum/Math/Angle.h
  2. 6
      src/Magnum/Math/DualComplex.h
  3. 6
      src/Magnum/Math/DualQuaternion.h
  4. 9
      src/Magnum/Math/Matrix.h
  5. 9
      src/Magnum/Math/Matrix3.h
  6. 9
      src/Magnum/Math/Matrix4.h
  7. 18
      src/Magnum/Math/Range.h
  8. 6
      src/Magnum/Math/RectangularMatrix.h
  9. 6
      src/Magnum/Math/Vector2.h
  10. 6
      src/Magnum/Math/Vector3.h
  11. 6
      src/Magnum/Math/Vector4.h

12
src/Magnum/Math/Angle.h

@ -124,10 +124,12 @@ std::sin(Float(Rad<Float>(b)); // required explicit conversion hints to user
template<class T> class Deg: public Unit<Deg, T> { template<class T> class Deg: public Unit<Deg, T> {
public: public:
/** @brief Construct zero angle */ /** @brief Construct zero angle */
constexpr /*implicit*/ Deg(ZeroInitT = ZeroInit): Unit<Math::Deg, T>{ZeroInit} {} /* MSVC 2015 can't handle {} here */
constexpr /*implicit*/ Deg(ZeroInitT = ZeroInit): Unit<Math::Deg, T>(ZeroInit) {}
/** @brief Construct without initializing the contents */ /** @brief Construct without initializing the contents */
explicit Deg(NoInitT): Unit<Math::Deg, T>{NoInit} {} /* MSVC 2015 can't handle {} here */
explicit Deg(NoInitT): Unit<Math::Deg, T>(NoInit) {}
/** @brief Explicit constructor from unitless type */ /** @brief Explicit constructor from unitless type */
constexpr explicit Deg(T value): Unit<Math::Deg, T>(value) {} constexpr explicit Deg(T value): Unit<Math::Deg, T>(value) {}
@ -185,10 +187,12 @@ See @ref Deg for more information.
template<class T> class Rad: public Unit<Rad, T> { template<class T> class Rad: public Unit<Rad, T> {
public: public:
/** @brief Default constructor */ /** @brief Default constructor */
constexpr /*implicit*/ Rad(ZeroInitT = ZeroInit): Unit<Math::Rad, T>{ZeroInit} {} /* MSVC 2015 can't handle {} here */
constexpr /*implicit*/ Rad(ZeroInitT = ZeroInit): Unit<Math::Rad, T>(ZeroInit) {}
/** @brief Construct without initializing the contents */ /** @brief Construct without initializing the contents */
explicit Rad(NoInitT): Unit<Math::Rad, T>{NoInit} {} /* MSVC 2015 can't handle {} here */
explicit Rad(NoInitT): Unit<Math::Rad, T>(NoInit) {}
/** @brief Construct from unitless type */ /** @brief Construct from unitless type */
constexpr explicit Rad(T value): Unit<Math::Rad, T>(value) {} constexpr explicit Rad(T value): Unit<Math::Rad, T>(value) {}

6
src/Magnum/Math/DualComplex.h

@ -113,7 +113,8 @@ template<class T> class DualComplex: public Dual<Complex<T>> {
constexpr explicit DualComplex(ZeroInitT) constexpr explicit DualComplex(ZeroInitT)
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: Dual<Complex<T>>{Complex<T>{ZeroInit}, Complex<T>{ZeroInit}} /* MSVC 2015 can't handle {} here */
: Dual<Complex<T>>(Complex<T>{ZeroInit}, Complex<T>{ZeroInit})
#endif #endif
{} {}
@ -121,7 +122,8 @@ template<class T> class DualComplex: public Dual<Complex<T>> {
explicit DualComplex(NoInitT) explicit DualComplex(NoInitT)
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: Dual<Complex<T>>{NoInit} /* MSVC 2015 can't handle {} here */
: Dual<Complex<T>>(NoInit)
#endif #endif
{} {}

6
src/Magnum/Math/DualQuaternion.h

@ -120,7 +120,8 @@ template<class T> class DualQuaternion: public Dual<Quaternion<T>> {
constexpr explicit DualQuaternion(ZeroInitT) constexpr explicit DualQuaternion(ZeroInitT)
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: Dual<Quaternion<T>>{Quaternion<T>{ZeroInit}, Quaternion<T>{ZeroInit}} /* MSVC 2015 can't handle {} here */
: Dual<Quaternion<T>>(Quaternion<T>{ZeroInit}, Quaternion<T>{ZeroInit})
#endif #endif
{} {}
@ -128,7 +129,8 @@ template<class T> class DualQuaternion: public Dual<Quaternion<T>> {
explicit DualQuaternion(NoInitT) explicit DualQuaternion(NoInitT)
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: Dual<Quaternion<T>>{NoInit} /* MSVC 2015 can't handle {} here */
: Dual<Quaternion<T>>(NoInit)
#endif #endif
{} {}

9
src/Magnum/Math/Matrix.h

@ -86,7 +86,8 @@ template<std::size_t size, class T> class Matrix: public RectangularMatrix<size,
constexpr /*implicit*/ Matrix(IdentityInitT = IdentityInit, T value = T(1)) constexpr /*implicit*/ Matrix(IdentityInitT = IdentityInit, T value = T(1))
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: RectangularMatrix<size, size, T>{typename Implementation::GenerateSequence<size>::Type(), Vector<size, T>(value)} /* MSVC 2015 can't handle {} here */
: RectangularMatrix<size, size, T>(typename Implementation::GenerateSequence<size>::Type(), Vector<size, T>(value))
#endif #endif
{} {}
@ -94,7 +95,8 @@ template<std::size_t size, class T> class Matrix: public RectangularMatrix<size,
constexpr explicit Matrix(ZeroInitT) constexpr explicit Matrix(ZeroInitT)
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: RectangularMatrix<size, size, T>{ZeroInit} /* MSVC 2015 can't handle {} here */
: RectangularMatrix<size, size, T>(ZeroInit)
#endif #endif
{} {}
@ -102,7 +104,8 @@ template<std::size_t size, class T> class Matrix: public RectangularMatrix<size,
constexpr explicit Matrix(NoInitT) constexpr explicit Matrix(NoInitT)
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: RectangularMatrix<size, size, T>{NoInit} /* MSVC 2015 can't handle {} here */
: RectangularMatrix<size, size, T>(NoInit)
#endif #endif
{} {}

9
src/Magnum/Math/Matrix3.h

@ -162,7 +162,8 @@ template<class T> class Matrix3: public Matrix3x3<T> {
constexpr /*implicit*/ Matrix3(IdentityInitT = IdentityInit, T value = T{1}) constexpr /*implicit*/ Matrix3(IdentityInitT = IdentityInit, T value = T{1})
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: Matrix3x3<T>{IdentityInit, value} /* MSVC 2015 can't handle {} here */
: Matrix3x3<T>(IdentityInit, value)
#endif #endif
{} {}
@ -170,7 +171,8 @@ template<class T> class Matrix3: public Matrix3x3<T> {
constexpr explicit Matrix3(ZeroInitT) constexpr explicit Matrix3(ZeroInitT)
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: Matrix3x3<T>{ZeroInit} /* MSVC 2015 can't handle {} here */
: Matrix3x3<T>(ZeroInit)
#endif #endif
{} {}
@ -178,7 +180,8 @@ template<class T> class Matrix3: public Matrix3x3<T> {
constexpr explicit Matrix3(NoInitT) constexpr explicit Matrix3(NoInitT)
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: Matrix3x3<T>{NoInit} /* MSVC 2015 can't handle {} here */
: Matrix3x3<T>(NoInit)
#endif #endif
{} {}

9
src/Magnum/Math/Matrix4.h

@ -258,7 +258,8 @@ template<class T> class Matrix4: public Matrix4x4<T> {
constexpr /*implicit*/ Matrix4(IdentityInitT = IdentityInit, T value = T{1}) constexpr /*implicit*/ Matrix4(IdentityInitT = IdentityInit, T value = T{1})
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: Matrix4x4<T>{IdentityInit, value} /* MSVC 2015 can't handle {} here */
: Matrix4x4<T>(IdentityInit, value)
#endif #endif
{} {}
@ -266,7 +267,8 @@ template<class T> class Matrix4: public Matrix4x4<T> {
constexpr explicit Matrix4(ZeroInitT) constexpr explicit Matrix4(ZeroInitT)
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: Matrix4x4<T>{ZeroInit} /* MSVC 2015 can't handle {} here */
: Matrix4x4<T>(ZeroInit)
#endif #endif
{} {}
@ -274,7 +276,8 @@ template<class T> class Matrix4: public Matrix4x4<T> {
constexpr explicit Matrix4(NoInitT) constexpr explicit Matrix4(NoInitT)
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: Matrix4x4<T>{NoInit} /* MSVC 2015 can't handle {} here */
: Matrix4x4<T>(NoInit)
#endif #endif
{} {}

18
src/Magnum/Math/Range.h

@ -225,7 +225,8 @@ template<class T> class Range2D: public Range<2, T> {
constexpr /*implicit*/ Range2D(ZeroInitT = ZeroInit) constexpr /*implicit*/ Range2D(ZeroInitT = ZeroInit)
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: Range<2, T>{ZeroInit} /* MSVC 2015 can't handle {} here */
: Range<2, T>(ZeroInit)
#endif #endif
{} {}
@ -233,7 +234,8 @@ template<class T> class Range2D: public Range<2, T> {
explicit Range2D(NoInitT) explicit Range2D(NoInitT)
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: Range<2, T>{NoInit} /* MSVC 2015 can't handle {} here */
: Range<2, T>(NoInit)
#endif #endif
{} {}
@ -252,7 +254,8 @@ template<class T> class Range2D: public Range<2, T> {
*/ */
template<class U, class V = decltype(Implementation::RangeConverter<2, T, U>::from(std::declval<U>()))> constexpr explicit Range2D(const U& other) template<class U, class V = decltype(Implementation::RangeConverter<2, T, U>::from(std::declval<U>()))> constexpr explicit Range2D(const U& other)
#ifndef DOXYGEN_GENERATING_OUTPUT #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 #endif
{} {}
@ -349,7 +352,8 @@ template<class T> class Range3D: public Range<3, T> {
constexpr /*implicit*/ Range3D(ZeroInitT = ZeroInit) constexpr /*implicit*/ Range3D(ZeroInitT = ZeroInit)
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: Range<3, T>{ZeroInit} /* MSVC 2015 can't handle {} here */
: Range<3, T>(ZeroInit)
#endif #endif
{} {}
@ -357,7 +361,8 @@ template<class T> class Range3D: public Range<3, T> {
explicit Range3D(NoInitT) explicit Range3D(NoInitT)
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: Range<3, T>{NoInit} /* MSVC 2015 can't handle {} here */
: Range<3, T>(NoInit)
#endif #endif
{} {}
@ -376,7 +381,8 @@ template<class T> class Range3D: public Range<3, T> {
*/ */
template<class U, class V = decltype(Implementation::RangeConverter<3, T, U>::from(std::declval<U>()))> constexpr explicit Range3D(const U& other) template<class U, class V = decltype(Implementation::RangeConverter<3, T, U>::from(std::declval<U>()))> constexpr explicit Range3D(const U& other)
#ifndef DOXYGEN_GENERATING_OUTPUT #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 #endif
{} {}

6
src/Magnum/Math/RectangularMatrix.h

@ -111,7 +111,8 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
constexpr /*implicit*/ RectangularMatrix(ZeroInitT = ZeroInit) constexpr /*implicit*/ RectangularMatrix(ZeroInitT = ZeroInit)
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: RectangularMatrix<cols, rows, T>{typename Implementation::GenerateSequence<cols>::Type{}, ZeroInit} /* MSVC 2015 can't handle {} here */
: RectangularMatrix<cols, rows, T>(typename Implementation::GenerateSequence<cols>::Type{}, ZeroInit)
#endif #endif
{} {}
@ -119,7 +120,8 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
explicit RectangularMatrix(NoInitT) explicit RectangularMatrix(NoInitT)
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: RectangularMatrix<cols, rows, T>{typename Implementation::GenerateSequence<cols>::Type{}, NoInit} /* MSVC 2015 can't handle {} here */
: RectangularMatrix<cols, rows, T>(typename Implementation::GenerateSequence<cols>::Type{}, NoInit)
#endif #endif
{} {}

6
src/Magnum/Math/Vector2.h

@ -115,7 +115,8 @@ template<class T> class Vector2: public Vector<2, T> {
constexpr /*implicit*/ Vector2(ZeroInitT = ZeroInit) constexpr /*implicit*/ Vector2(ZeroInitT = ZeroInit)
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: Vector<2, T>{ZeroInit} /* MSVC 2015 can't handle {} here */
: Vector<2, T>(ZeroInit)
#endif #endif
{} {}
@ -123,7 +124,8 @@ template<class T> class Vector2: public Vector<2, T> {
explicit Vector2(NoInitT) explicit Vector2(NoInitT)
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: Vector<2, T>{NoInit} /* MSVC 2015 can't handle {} here */
: Vector<2, T>(NoInit)
#endif #endif
{} {}

6
src/Magnum/Math/Vector3.h

@ -137,7 +137,8 @@ template<class T> class Vector3: public Vector<3, T> {
constexpr /*implicit*/ Vector3(ZeroInitT = ZeroInit) constexpr /*implicit*/ Vector3(ZeroInitT = ZeroInit)
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: Vector<3, T>{ZeroInit} /* MSVC 2015 can't handle {} here */
: Vector<3, T>(ZeroInit)
#endif #endif
{} {}
@ -145,7 +146,8 @@ template<class T> class Vector3: public Vector<3, T> {
explicit Vector3(NoInitT) explicit Vector3(NoInitT)
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: Vector<3, T>{NoInit} /* MSVC 2015 can't handle {} here */
: Vector<3, T>(NoInit)
#endif #endif
{} {}

6
src/Magnum/Math/Vector4.h

@ -63,7 +63,8 @@ template<class T> class Vector4: public Vector<4, T> {
constexpr /*implicit*/ Vector4(ZeroInitT = ZeroInit) constexpr /*implicit*/ Vector4(ZeroInitT = ZeroInit)
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: Vector<4, T>{ZeroInit} /* MSVC 2015 can't handle {} here */
: Vector<4, T>(ZeroInit)
#endif #endif
{} {}
@ -71,7 +72,8 @@ template<class T> class Vector4: public Vector<4, T> {
explicit Vector4(NoInitT) explicit Vector4(NoInitT)
/** @todoc remove workaround when doxygen is sane */ /** @todoc remove workaround when doxygen is sane */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
: Vector<4, T>{NoInit} /* MSVC 2015 can't handle {} here */
: Vector<4, T>(NoInit)
#endif #endif
{} {}

Loading…
Cancel
Save