diff --git a/src/Math/Matrix.h b/src/Math/Matrix.h index bcc5c5db3..9833bbc16 100644 --- a/src/Math/Matrix.h +++ b/src/Math/Matrix.h @@ -70,7 +70,14 @@ template class Matrix: public RectangularMatrix(typename Implementation::GenerateSequence::Type(), Vector(value)) {} + constexpr /*implicit*/ Matrix(IdentityType = Identity, T value = T(1)): RectangularMatrix(typename Implementation::GenerateSequence::Type(), + /* The original one is not constexpr under GCC 4.6 */ + #ifndef CORRADE_GCC46_COMPATIBILITY + Vector(value) + #else + Vector(typename Implementation::GenerateSequence::Type(), value) + #endif + ) {} /** * @brief %Matrix from column vectors diff --git a/src/Math/Vector.h b/src/Math/Vector.h index 1b47329c7..a8ec1e645 100644 --- a/src/Math/Vector.h +++ b/src/Math/Vector.h @@ -59,6 +59,11 @@ template class Vector { template friend class Vector; + #ifdef CORRADE_GCC46_COMPATIBILITY + /* So it can call internal constexpr constructor from one value */ + template friend class Matrix; + #endif + public: typedef T Type; /**< @brief Underlying data type */ const static std::size_t Size = size; /**< @brief %Vector size */