diff --git a/src/Math/BoolVector.h b/src/Math/BoolVector.h index 14166de15..2ef2495ce 100644 --- a/src/Math/BoolVector.h +++ b/src/Math/BoolVector.h @@ -20,6 +20,7 @@ */ #include +#include #include "Types.h" @@ -75,7 +76,13 @@ template class BoolVector { #ifdef DOXYGEN_GENERATING_OUTPUT inline explicit BoolVector(T value); #else + #ifndef CORRADE_GCC46_COMPATIBILITY template::value && size != 1, bool>::type> inline constexpr explicit BoolVector(T value): BoolVector(typename Implementation::GenerateSequence::Type(), value ? FullSegmentMask : 0) {} + #else + template::value && size != 1, bool>::type> inline explicit BoolVector(T value) { + *this = BoolVector(typename Implementation::GenerateSequence::Type(), value ? FullSegmentMask : 0); + } + #endif #endif /** @brief Copy constructor */ diff --git a/src/Math/Test/BoolVectorTest.cpp b/src/Math/Test/BoolVectorTest.cpp index c0328348f..e4440965f 100644 --- a/src/Math/Test/BoolVectorTest.cpp +++ b/src/Math/Test/BoolVectorTest.cpp @@ -111,9 +111,11 @@ void BoolVectorTest::constExpressions() { constexpr BoolVector19 b(0xa5, 0x5f, 0x07); CORRADE_COMPARE(b, BoolVector19(0xa5, 0x5f, 0x07)); - /* One-value constructor */ + /* One-value constructor, not constexpr under GCC < 4.7 */ + #ifndef CORRADE_GCC46_COMPATIBILITY constexpr BoolVector19 c(true); CORRADE_COMPARE(c, BoolVector19(0xff, 0xff, 0x07)); + #endif /* Copy constructor */ constexpr BoolVector19 d(b);