Browse Source

Math: oh, MSVC 2015 constexpr fun is here again.

pull/268/merge
Vladimír Vondruš 8 years ago
parent
commit
08d51ec116
  1. 5
      src/Magnum/Math/Test/BezierTest.cpp
  2. 5
      src/Magnum/Math/Test/DualQuaternionTest.cpp
  3. 5
      src/Magnum/Math/Test/QuaternionTest.cpp
  4. 2
      src/Magnum/Math/Test/VectorTest.cpp

5
src/Magnum/Math/Test/BezierTest.cpp

@ -222,7 +222,10 @@ void BezierTest::data() {
Vector2 c = b[2];
CORRADE_COMPARE(c, (Vector2{0.0f, -1.2f}));
constexpr Vector2 d = *b.data();
#ifndef CORRADE_MSVC2015_COMPATIBILITY /* Why? */
constexpr
#endif
Vector2 d = *b.data();
Vector2 e = a.data()[2];
CORRADE_COMPARE(d, (Vector2{3.5f, 0.1f}));
CORRADE_COMPARE(e, (Vector2{0.7f, 20.3f}));

5
src/Magnum/Math/Test/DualQuaternionTest.cpp

@ -286,7 +286,10 @@ void DualQuaternionTest::data() {
DualQuaternion a{{{1.0f, 2.0f, 3.0f}, -4.0f}, {{0.5f, -3.1f, 3.3f}, 2.0f}};
constexpr Float d = *ca.data();
#ifndef CORRADE_MSVC2015_COMPATIBILITY /* Apparently dereferencing a pointer is verboten */
constexpr
#endif
Float d = *ca.data();
Float e = a.data()[7];
CORRADE_COMPARE(d, 1.0f);
CORRADE_COMPARE(e, 2.0f);

5
src/Magnum/Math/Test/QuaternionTest.cpp

@ -284,7 +284,10 @@ void QuaternionTest::data() {
a.scalar() = 1.1f;
CORRADE_COMPARE(a, (Quaternion{{1.0f, 4.3f, 3.0f}, 1.1f}));
constexpr Float b = *ca.data();
#ifndef CORRADE_MSVC2015_COMPATIBILITY /* Apparently dereferencing a pointer is verboten */
constexpr
#endif
Float b = *ca.data();
Float c = a.data()[3];
CORRADE_COMPARE(b, 1.0f);
CORRADE_COMPARE(c, 1.1f);

2
src/Magnum/Math/Test/VectorTest.cpp

@ -309,7 +309,7 @@ void VectorTest::data() {
/* Pointer chasings, i.e. *(b.data()[3]), are not possible */
constexpr Vector4 a(1.0f, 2.0f, -3.0f, 4.5f);
constexpr Float f = a[3];
#ifndef CORRADE_MSVC2015_COMPATIBILITY /* Apparently dereferencing pointer is verboten */
#ifndef CORRADE_MSVC2015_COMPATIBILITY /* Apparently dereferencing a pointer is verboten */
constexpr
#endif
Float g = *a.data();

Loading…
Cancel
Save