diff --git a/src/Math/Vector.h b/src/Math/Vector.h index 8d07e9ab5..a773b73a8 100644 --- a/src/Math/Vector.h +++ b/src/Math/Vector.h @@ -165,7 +165,11 @@ template class Vector { #ifndef CORRADE_GCC46_COMPATIBILITY template::from(std::declval()))> inline constexpr explicit Vector(const U& other): Vector(Implementation::VectorConverter::from(other)) {} #else + #ifndef CORRADE_GCC44_COMPATIBILITY template::from(std::declval()))> inline explicit Vector(const U& other) { + #else + template::from(*static_cast(nullptr)))> inline explicit Vector(const U& other) { + #endif *this = Implementation::VectorConverter::from(other); } #endif @@ -177,7 +181,11 @@ template class Vector { inline Vector& operator=(const Vector&) = default; /** @brief Convert vector to external representation */ + #ifndef CORRADE_GCC44_COMPATIBILITY template::to(std::declval>()))> inline constexpr explicit operator U() const { + #else + template::to(*static_cast*>(nullptr)))> inline constexpr operator U() const { + #endif /** @bug Why this is not constexpr under GCC 4.6? */ return Implementation::VectorConverter::to(*this); } diff --git a/src/Math/Vector2.h b/src/Math/Vector2.h index 148174cfb..acab7d8d2 100644 --- a/src/Math/Vector2.h +++ b/src/Math/Vector2.h @@ -99,7 +99,11 @@ template class Vector2: public Vector<2, T> { template inline constexpr explicit Vector2(const Vector<2, U>& other): Vector<2, T>(other) {} /** @brief Construct vector from external representation */ + #ifndef CORRADE_GCC44_COMPATIBILITY template::from(std::declval()))> inline constexpr explicit Vector2(const U& other): Vector<2, T>(Implementation::VectorConverter<2, T, U>::from(other)) {} + #else + template::from(*static_cast(nullptr)))> inline constexpr explicit Vector2(const U& other): Vector<2, T>(Implementation::VectorConverter<2, T, U>::from(other)) {} + #endif /** @brief Copy constructor */ inline constexpr Vector2(const Vector<2, T>& other): Vector<2, T>(other) {} diff --git a/src/Math/Vector3.h b/src/Math/Vector3.h index cbab75330..3dd0aa127 100644 --- a/src/Math/Vector3.h +++ b/src/Math/Vector3.h @@ -140,7 +140,11 @@ template class Vector3: public Vector<3, T> { template inline constexpr explicit Vector3(const Vector<3, U>& other): Vector<3, T>(other) {} /** @brief Construct vector from external representation */ + #ifndef CORRADE_GCC44_COMPATIBILITY template::from(std::declval()))> inline constexpr explicit Vector3(const U& other): Vector<3, T>(Implementation::VectorConverter<3, T, U>::from(other)) {} + #else + template::from(*static_cast(nullptr)))> inline constexpr explicit Vector3(const U& other): Vector<3, T>(Implementation::VectorConverter<3, T, U>::from(other)) {} + #endif /** @brief Copy constructor */ inline constexpr Vector3(const Vector<3, T>& other): Vector<3, T>(other) {} diff --git a/src/Math/Vector4.h b/src/Math/Vector4.h index 6e40b12be..a54e9372a 100644 --- a/src/Math/Vector4.h +++ b/src/Math/Vector4.h @@ -70,7 +70,11 @@ template class Vector4: public Vector<4, T> { template inline constexpr explicit Vector4(const Vector<4, U>& other): Vector<4, T>(other) {} /** @brief Construct vector from external representation */ + #ifndef CORRADE_GCC44_COMPATIBILITY template::from(std::declval()))> inline constexpr explicit Vector4(const U& other): Vector<4, T>(Implementation::VectorConverter<4, T, U>::from(other)) {} + #else + template::from(*static_cast(nullptr)))> inline constexpr explicit Vector4(const U& other): Vector<4, T>(Implementation::VectorConverter<4, T, U>::from(other)) {} + #endif /** @brief Copy constructor */ inline constexpr Vector4(const Vector<4, T>& other): Vector<4, T>(other) {}