Browse Source

GCC 4.6 compatibility: no delegating ctr in Math::RectangularMatrix.

pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
99062ed248
  1. 6
      src/Math/RectangularMatrix.h
  2. 4
      src/Math/Test/RectangularMatrixTest.cpp

6
src/Math/RectangularMatrix.h

@ -112,7 +112,13 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
* // integral == {1, 2, -15, 7}
* @endcode
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class U> inline constexpr explicit RectangularMatrix(const RectangularMatrix<cols, rows, U>& other): RectangularMatrix(typename Implementation::GenerateSequence<cols>::Type(), other) {}
#else
template<class U> inline explicit RectangularMatrix(const RectangularMatrix<cols, rows, U>& other) {
*this = RectangularMatrix(typename Implementation::GenerateSequence<cols>::Type(), other);
}
#endif
/** @brief Copy constructor */
inline constexpr RectangularMatrix(const RectangularMatrix<cols, rows, T>&) = default;

4
src/Math/Test/RectangularMatrixTest.cpp

@ -193,13 +193,15 @@ void RectangularMatrixTest::constExpressions() {
Vector4(4.5f, 4.0f, 7.0f, 3.0f),
Vector4(7.0f, -1.7f, 8.0f, 0.0f)));
/* Conversion constructor */
/* Conversion constructor, not constexpr under GCC < 4.7 */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef RectangularMatrix<3, 4, Int> Matrix3x4i;
typedef Vector<4, Int> Vector4i;
constexpr Matrix3x4i c(b);
CORRADE_COMPARE(c, Matrix3x4i(Vector4i(3, 5, 8, 4),
Vector4i(4, 4, 7, 3),
Vector4i(7, -1, 8, 0)));
#endif
/* Copy constructor */
constexpr Matrix3x4 d(b);

Loading…
Cancel
Save