Browse Source

MSVC 2013 compatibility: constexpr-related issues.

Vladimír Vondruš 13 years ago
parent
commit
413bd4639e
  1. 2
      src/Math/Algorithms/Svd.h
  2. 2
      src/Math/Test/Vector2Test.cpp
  3. 2
      src/Math/Test/Vector3Test.cpp
  4. 2
      src/Math/Test/Vector4Test.cpp
  5. 8
      src/Test/ColorTest.cpp

2
src/Math/Algorithms/Svd.h

@ -97,7 +97,7 @@ decomposition and least squares solutions"*.
template<std::size_t cols, std::size_t rows, class T> std::tuple<RectangularMatrix<cols, rows, T>, Vector<cols, T>, Matrix<cols, T>> svd(RectangularMatrix<cols, rows, T> m) {
static_assert(rows >= cols, "Unsupported matrix aspect ratio");
constexpr T tol = Implementation::smallestDelta<T>()/TypeTraits<T>::epsilon();
#ifndef CORRADE_GCC45_COMPATIBILITY
#if !defined(CORRADE_GCC45_COMPATIBILITY) && !defined(CORRADE_MSVC2013_COMPATIBILITY)
static_assert(T(1)+TypeTraits<T>::epsilon() > T(1), "Epsilon too small");
static_assert(tol > T(0), "Tol too small");
#else

2
src/Math/Test/Vector2Test.cpp

@ -222,7 +222,7 @@ void Vector2Test::minmax() {
void Vector2Test::swizzleType() {
constexpr Vector<4, Int> orig;
#ifndef CORRADE_GCC45_COMPATIBILITY
#if !defined(CORRADE_GCC45_COMPATIBILITY) && !defined(CORRADE_MSVC2013_COMPATIBILITY)
constexpr
#else
const

2
src/Math/Test/Vector3Test.cpp

@ -236,7 +236,7 @@ void Vector3Test::twoComponent() {
void Vector3Test::swizzleType() {
constexpr Vector<4, Int> orig;
#ifndef CORRADE_GCC45_COMPATIBILITY
#if !defined(CORRADE_GCC45_COMPATIBILITY) && !defined(CORRADE_MSVC2013_COMPATIBILITY)
constexpr
#else
const

2
src/Math/Test/Vector4Test.cpp

@ -227,7 +227,7 @@ void Vector4Test::twoComponent() {
void Vector4Test::swizzleType() {
constexpr Vector4i orig;
#ifndef CORRADE_GCC45_COMPATIBILITY
#if !defined(CORRADE_GCC45_COMPATIBILITY) && !defined(CORRADE_MSVC2013_COMPATIBILITY)
constexpr
#else
const

8
src/Test/ColorTest.cpp

@ -296,7 +296,7 @@ void ColorTest::swizzleType() {
constexpr Color3 origColor3;
constexpr BasicColor4<UnsignedByte> origColor4;
#ifndef CORRADE_GCC45_COMPATIBILITY
#if !defined(CORRADE_GCC45_COMPATIBILITY) && !defined(CORRADE_MSVC2013_COMPATIBILITY)
constexpr
#else
const
@ -304,7 +304,7 @@ void ColorTest::swizzleType() {
auto a = Math::swizzle<'y', 'z', 'r'>(origColor3);
CORRADE_VERIFY((std::is_same<decltype(a), const Color3>::value));
#ifndef CORRADE_GCC45_COMPATIBILITY
#if !defined(CORRADE_GCC45_COMPATIBILITY) && !defined(CORRADE_MSVC2013_COMPATIBILITY)
constexpr
#else
const
@ -312,7 +312,7 @@ void ColorTest::swizzleType() {
auto b = Math::swizzle<'y', 'z', 'a'>(origColor4);
CORRADE_VERIFY((std::is_same<decltype(b), const BasicColor3<UnsignedByte>>::value));
#ifndef CORRADE_GCC45_COMPATIBILITY
#if !defined(CORRADE_GCC45_COMPATIBILITY) && !defined(CORRADE_MSVC2013_COMPATIBILITY)
constexpr
#else
const
@ -320,7 +320,7 @@ void ColorTest::swizzleType() {
auto c = Math::swizzle<'y', 'z', 'y', 'x'>(origColor3);
CORRADE_VERIFY((std::is_same<decltype(c), const Color4>::value));
#ifndef CORRADE_GCC45_COMPATIBILITY
#if !defined(CORRADE_GCC45_COMPATIBILITY) && !defined(CORRADE_MSVC2013_COMPATIBILITY)
constexpr
#else
const

Loading…
Cancel
Save