From 1d981dd3447c327eee6fa6cb8f346f5e96c999ef Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 8 Feb 2014 12:40:34 +0100 Subject: [PATCH] Fixed initializer list ambiguity (#159, #160) --- glm/detail/type_mat2x2.hpp | 15 ++++----------- glm/detail/type_mat2x2.inl | 23 ----------------------- glm/detail/type_mat2x3.hpp | 15 ++++----------- glm/detail/type_mat2x3.inl | 23 ----------------------- glm/detail/type_mat2x4.hpp | 17 +++++------------ glm/detail/type_mat2x4.inl | 23 ----------------------- glm/detail/type_mat3x2.hpp | 15 ++++----------- glm/detail/type_mat3x2.inl | 25 ------------------------- glm/detail/type_mat3x3.hpp | 15 ++++----------- glm/detail/type_mat3x3.inl | 25 ------------------------- glm/detail/type_mat3x4.hpp | 15 ++++----------- glm/detail/type_mat3x4.inl | 25 ------------------------- glm/detail/type_mat4x2.hpp | 15 ++++----------- glm/detail/type_mat4x2.inl | 27 --------------------------- glm/detail/type_mat4x3.hpp | 15 ++++----------- glm/detail/type_mat4x3.inl | 27 --------------------------- glm/detail/type_mat4x4.hpp | 15 ++++----------- glm/detail/type_mat4x4.inl | 27 --------------------------- glm/detail/type_vec2.hpp | 11 +++-------- glm/detail/type_vec2.inl | 11 ----------- glm/detail/type_vec3.hpp | 9 ++------- glm/detail/type_vec3.inl | 12 ------------ glm/detail/type_vec4.hpp | 9 ++------- glm/detail/type_vec4.inl | 13 ------------- readme.txt | 3 ++- test/core/core_type_mat4x4.cpp | 13 +++++++++++++ 26 files changed, 59 insertions(+), 384 deletions(-) diff --git a/glm/detail/type_mat2x2.hpp b/glm/detail/type_mat2x2.hpp index 8175b777..ded6714e 100644 --- a/glm/detail/type_mat2x2.hpp +++ b/glm/detail/type_mat2x2.hpp @@ -72,29 +72,22 @@ namespace detail ctor Null); GLM_FUNC_DECL explicit tmat2x2( T const & x); - GLM_FUNC_DECL explicit tmat2x2( + GLM_FUNC_DECL tmat2x2( T const & x1, T const & y1, T const & x2, T const & y2); - GLM_FUNC_DECL explicit tmat2x2( + GLM_FUNC_DECL tmat2x2( col_type const & v1, col_type const & v2); -#if(GLM_HAS_INITIALIZER_LISTS) - template - GLM_FUNC_DECL tmat2x2(std::initializer_list m); - - GLM_FUNC_DECL tmat2x2(std::initializer_list > m); -#endif//GLM_HAS_INITIALIZER_LISTS - ////////////////////////////////////// // Conversions template - GLM_FUNC_DECL explicit tmat2x2( + GLM_FUNC_DECL tmat2x2( U const & x1, V const & y1, M const & x2, N const & y2); template - GLM_FUNC_DECL explicit tmat2x2( + GLM_FUNC_DECL tmat2x2( tvec2 const & v1, tvec2 const & v2); diff --git a/glm/detail/type_mat2x2.inl b/glm/detail/type_mat2x2.inl index 85e79baa..5dd86fb0 100644 --- a/glm/detail/type_mat2x2.inl +++ b/glm/detail/type_mat2x2.inl @@ -129,29 +129,6 @@ namespace detail this->value[1] = v1; } -#if(GLM_HAS_INITIALIZER_LISTS) - template - template - GLM_FUNC_QUALIFIER tmat2x2::tmat2x2(std::initializer_list l) - { - assert(l.size() == this->length() * this->value[0].length()); - - typename std::initializer_list::iterator p = l.begin(); - - this->value[0] = tvec2(*(p + 0), *(p + 1)); - this->value[1] = tvec2(*(p + 2), *(p + 3)); - } - - template - GLM_FUNC_QUALIFIER tmat2x2::tmat2x2(std::initializer_list > l) - { - assert(l.size() == this->length()); - - this->value[0] = l.begin()[0]; - this->value[1] = l.begin()[1]; - } -#endif//GLM_HAS_INITIALIZER_LISTS - ////////////////////////////////////// // Conversion constructors template diff --git a/glm/detail/type_mat2x3.hpp b/glm/detail/type_mat2x3.hpp index 0b65376b..086e28cb 100644 --- a/glm/detail/type_mat2x3.hpp +++ b/glm/detail/type_mat2x3.hpp @@ -66,29 +66,22 @@ namespace detail ctor); GLM_FUNC_DECL explicit tmat2x3( T const & s); - GLM_FUNC_DECL explicit tmat2x3( + GLM_FUNC_DECL tmat2x3( T const & x0, T const & y0, T const & z0, T const & x1, T const & y1, T const & z1); - GLM_FUNC_DECL explicit tmat2x3( + GLM_FUNC_DECL tmat2x3( col_type const & v0, col_type const & v1); -#if(GLM_HAS_INITIALIZER_LISTS) - template - GLM_FUNC_DECL tmat2x3(std::initializer_list m); - - GLM_FUNC_DECL tmat2x3(std::initializer_list > m); -#endif//GLM_HAS_INITIALIZER_LISTS - ////////////////////////////////////// // Conversions template - GLM_FUNC_DECL explicit tmat2x3( + GLM_FUNC_DECL tmat2x3( X1 const & x1, Y1 const & y1, Z1 const & z1, X2 const & x2, Y2 const & y2, Z2 const & z2); template - GLM_FUNC_DECL explicit tmat2x3( + GLM_FUNC_DECL tmat2x3( tvec3 const & v1, tvec3 const & v2); diff --git a/glm/detail/type_mat2x3.inl b/glm/detail/type_mat2x3.inl index b1d46d9e..6d0c5514 100644 --- a/glm/detail/type_mat2x3.inl +++ b/glm/detail/type_mat2x3.inl @@ -128,29 +128,6 @@ namespace detail this->value[1] = v1; } -#if(GLM_HAS_INITIALIZER_LISTS) - template - template - GLM_FUNC_QUALIFIER tmat2x3::tmat2x3(std::initializer_list l) - { - assert(l.size() == this->length() * this->value[0].length()); - - typename std::initializer_list::iterator p = l.begin(); - - this->value[0] = tvec3(*(p + 0), *(p + 1), *(p + 2)); - this->value[1] = tvec3(*(p + 3), *(p + 4), *(p + 5)); - } - - template - GLM_FUNC_QUALIFIER tmat2x3::tmat2x3(std::initializer_list > l) - { - assert(l.size() == this->length()); - - this->value[0] = l.begin()[0]; - this->value[1] = l.begin()[1]; - } -#endif//GLM_HAS_INITIALIZER_LISTS - ////////////////////////////////////// // Conversion constructors template diff --git a/glm/detail/type_mat2x4.hpp b/glm/detail/type_mat2x4.hpp index a2be70b8..7ff7e5c2 100644 --- a/glm/detail/type_mat2x4.hpp +++ b/glm/detail/type_mat2x4.hpp @@ -66,31 +66,24 @@ namespace detail ctor); GLM_FUNC_DECL explicit tmat2x4( T const & s); - GLM_FUNC_DECL explicit tmat2x4( + GLM_FUNC_DECL tmat2x4( T const & x0, T const & y0, T const & z0, T const & w0, T const & x1, T const & y1, T const & z1, T const & w1); - GLM_FUNC_DECL explicit tmat2x4( + GLM_FUNC_DECL tmat2x4( col_type const & v0, col_type const & v1); -#if(GLM_HAS_INITIALIZER_LISTS) - template - GLM_FUNC_DECL tmat2x4(std::initializer_list m); - - GLM_FUNC_DECL tmat2x4(std::initializer_list > m); -#endif//GLM_HAS_INITIALIZER_LISTS - ////////////////////////////////////// // Conversions template < typename X1, typename Y1, typename Z1, typename W1, typename X2, typename Y2, typename Z2, typename W2> - GLM_FUNC_DECL explicit tmat2x4( + GLM_FUNC_DECL tmat2x4( X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2); - + template - GLM_FUNC_DECL explicit tmat2x4( + GLM_FUNC_DECL tmat2x4( tvec4 const & v1, tvec4 const & v2); diff --git a/glm/detail/type_mat2x4.inl b/glm/detail/type_mat2x4.inl index 30540797..22197e34 100644 --- a/glm/detail/type_mat2x4.inl +++ b/glm/detail/type_mat2x4.inl @@ -131,29 +131,6 @@ namespace detail this->value[1] = v1; } -#if(GLM_HAS_INITIALIZER_LISTS) - template - template - GLM_FUNC_QUALIFIER tmat2x4::tmat2x4(std::initializer_list l) - { - assert(l.size() == this->length() * this->value[0].length()); - - typename std::initializer_list::iterator p = l.begin(); - - this->value[0] = tvec4(*(p + 0), *(p + 1), *(p + 2), *(p + 3)); - this->value[1] = tvec4(*(p + 4), *(p + 5), *(p + 6), *(p + 7)); - } - - template - GLM_FUNC_QUALIFIER tmat2x4::tmat2x4(std::initializer_list > l) - { - assert(l.size() == this->length()); - - this->value[0] = l.begin()[0]; - this->value[1] = l.begin()[1]; - } -#endif//GLM_HAS_INITIALIZER_LISTS - ////////////////////////////////////// // Conversion constructors template diff --git a/glm/detail/type_mat3x2.hpp b/glm/detail/type_mat3x2.hpp index 99b3a8e3..8c690000 100644 --- a/glm/detail/type_mat3x2.hpp +++ b/glm/detail/type_mat3x2.hpp @@ -66,35 +66,28 @@ namespace detail ctor); GLM_FUNC_DECL explicit tmat3x2( T const & s); - GLM_FUNC_DECL explicit tmat3x2( + GLM_FUNC_DECL tmat3x2( T const & x0, T const & y0, T const & x1, T const & y1, T const & x2, T const & y2); - GLM_FUNC_DECL explicit tmat3x2( + GLM_FUNC_DECL tmat3x2( col_type const & v0, col_type const & v1, col_type const & v2); -#if(GLM_HAS_INITIALIZER_LISTS) - template - GLM_FUNC_DECL tmat3x2(std::initializer_list l); - - GLM_FUNC_DECL tmat3x2(std::initializer_list > l); -#endif//GLM_HAS_INITIALIZER_LISTS - ////////////////////////////////////// // Conversions template< typename X1, typename Y1, typename X2, typename Y2, typename X3, typename Y3> - GLM_FUNC_DECL explicit tmat3x2( + GLM_FUNC_DECL tmat3x2( X1 const & x1, Y1 const & y1, X2 const & x2, Y2 const & y2, X3 const & x3, Y3 const & y3); template - GLM_FUNC_DECL explicit tmat3x2( + GLM_FUNC_DECL tmat3x2( tvec2 const & v1, tvec2 const & v2, tvec2 const & v3); diff --git a/glm/detail/type_mat3x2.inl b/glm/detail/type_mat3x2.inl index 829be7c0..4d79ad9d 100644 --- a/glm/detail/type_mat3x2.inl +++ b/glm/detail/type_mat3x2.inl @@ -136,31 +136,6 @@ namespace detail this->value[2] = v2; } -#if(GLM_HAS_INITIALIZER_LISTS) - template - template - GLM_FUNC_QUALIFIER tmat3x2::tmat3x2(std::initializer_list l) - { - assert(l.size() == this->length() * this->value[0].length()); - - typename std::initializer_list::iterator p = l.begin(); - - this->value[0] = tvec2(*(p + 0), *(p + 1)); - this->value[1] = tvec2(*(p + 2), *(p + 3)); - this->value[2] = tvec2(*(p + 4), *(p + 5)); - } - - template - GLM_FUNC_QUALIFIER tmat3x2::tmat3x2(std::initializer_list > l) - { - assert(l.size() == this->length()); - - this->value[0] = l.begin()[0]; - this->value[1] = l.begin()[1]; - this->value[2] = l.begin()[2]; - } -#endif//GLM_HAS_INITIALIZER_LISTS - ////////////////////////////////////// // Conversion constructors template diff --git a/glm/detail/type_mat3x3.hpp b/glm/detail/type_mat3x3.hpp index 642c2432..e2c11741 100644 --- a/glm/detail/type_mat3x3.hpp +++ b/glm/detail/type_mat3x3.hpp @@ -71,35 +71,28 @@ namespace detail ctor Null); GLM_FUNC_DECL explicit tmat3x3( T const & s); - GLM_FUNC_DECL explicit tmat3x3( + GLM_FUNC_DECL tmat3x3( T const & x0, T const & y0, T const & z0, T const & x1, T const & y1, T const & z1, T const & x2, T const & y2, T const & z2); - GLM_FUNC_DECL explicit tmat3x3( + GLM_FUNC_DECL tmat3x3( col_type const & v0, col_type const & v1, col_type const & v2); -#if(GLM_HAS_INITIALIZER_LISTS) - template - GLM_FUNC_DECL tmat3x3(std::initializer_list m); - - GLM_FUNC_DECL tmat3x3(std::initializer_list > m); -#endif//GLM_HAS_INITIALIZER_LISTS - ////////////////////////////////////// // Conversions template< typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2, typename X3, typename Y3, typename Z3> - GLM_FUNC_DECL explicit tmat3x3( + GLM_FUNC_DECL tmat3x3( X1 const & x1, Y1 const & y1, Z1 const & z1, X2 const & x2, Y2 const & y2, Z2 const & z2, X3 const & x3, Y3 const & y3, Z3 const & z3); template - GLM_FUNC_DECL explicit tmat3x3( + GLM_FUNC_DECL tmat3x3( tvec3 const & v1, tvec3 const & v2, tvec3 const & v3); diff --git a/glm/detail/type_mat3x3.inl b/glm/detail/type_mat3x3.inl index b64a5bfc..c8b0a27b 100644 --- a/glm/detail/type_mat3x3.inl +++ b/glm/detail/type_mat3x3.inl @@ -139,31 +139,6 @@ namespace detail this->value[2] = v2; } -#if(GLM_HAS_INITIALIZER_LISTS) - template - template - GLM_FUNC_QUALIFIER tmat3x3::tmat3x3(std::initializer_list l) - { - assert(l.size() == this->length() * this->value[0].length()); - - typename std::initializer_list::iterator p = l.begin(); - - this->value[0] = tvec3(*(p + 0), *(p + 1), *(p + 2)); - this->value[1] = tvec3(*(p + 3), *(p + 4), *(p + 5)); - this->value[2] = tvec3(*(p + 6), *(p + 7), *(p + 8)); - } - - template - GLM_FUNC_QUALIFIER tmat3x3::tmat3x3(std::initializer_list > l) - { - assert(l.size() == this->length()); - - this->value[0] = l.begin()[0]; - this->value[1] = l.begin()[1]; - this->value[2] = l.begin()[2]; - } -#endif//GLM_HAS_INITIALIZER_LISTS - ////////////////////////////////////// // Conversion constructors template diff --git a/glm/detail/type_mat3x4.hpp b/glm/detail/type_mat3x4.hpp index 4efaf5fd..106beca0 100644 --- a/glm/detail/type_mat3x4.hpp +++ b/glm/detail/type_mat3x4.hpp @@ -66,35 +66,28 @@ namespace detail ctor Null); GLM_FUNC_DECL explicit tmat3x4( T const & s); - GLM_FUNC_DECL explicit tmat3x4( + GLM_FUNC_DECL tmat3x4( T const & x0, T const & y0, T const & z0, T const & w0, T const & x1, T const & y1, T const & z1, T const & w1, T const & x2, T const & y2, T const & z2, T const & w2); - GLM_FUNC_DECL explicit tmat3x4( + GLM_FUNC_DECL tmat3x4( col_type const & v0, col_type const & v1, col_type const & v2); -#if(GLM_HAS_INITIALIZER_LISTS) - template - GLM_FUNC_DECL tmat3x4(std::initializer_list m); - - GLM_FUNC_DECL tmat3x4(std::initializer_list > m); -#endif//GLM_HAS_INITIALIZER_LISTS - ////////////////////////////////////// // Conversions template< typename X1, typename Y1, typename Z1, typename W1, typename X2, typename Y2, typename Z2, typename W2, typename X3, typename Y3, typename Z3, typename W3> - GLM_FUNC_DECL explicit tmat3x4( + GLM_FUNC_DECL tmat3x4( X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2, X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3); template - GLM_FUNC_DECL explicit tmat3x4( + GLM_FUNC_DECL tmat3x4( tvec4 const & v1, tvec4 const & v2, tvec4 const & v3); diff --git a/glm/detail/type_mat3x4.inl b/glm/detail/type_mat3x4.inl index eca5f7e8..fc33191f 100644 --- a/glm/detail/type_mat3x4.inl +++ b/glm/detail/type_mat3x4.inl @@ -169,31 +169,6 @@ namespace detail this->value[1] = col_type(v2); this->value[2] = col_type(v3); } - -#if(GLM_HAS_INITIALIZER_LISTS) - template - template - GLM_FUNC_QUALIFIER tmat3x4::tmat3x4(std::initializer_list l) - { - assert(l.size() == this->length() * this->value[0].length()); - - typename std::initializer_list::iterator p = l.begin(); - - this->value[0] = tvec4(*(p + 0), *(p + 1), *(p + 2), *(p + 3)); - this->value[1] = tvec4(*(p + 4), *(p + 5), *(p + 6), *(p + 7)); - this->value[2] = tvec4(*(p + 8), *(p + 9), *(p + 10), *(p + 11)); - } - - template - GLM_FUNC_QUALIFIER tmat3x4::tmat3x4(std::initializer_list > l) - { - assert(l.size() == this->length()); - - this->value[0] = l.begin()[0]; - this->value[1] = l.begin()[1]; - this->value[2] = l.begin()[2]; - } -#endif//GLM_HAS_INITIALIZER_LISTS // Conversion template diff --git a/glm/detail/type_mat4x2.hpp b/glm/detail/type_mat4x2.hpp index 5f1b4c03..d8612099 100644 --- a/glm/detail/type_mat4x2.hpp +++ b/glm/detail/type_mat4x2.hpp @@ -66,24 +66,17 @@ namespace detail ctor Null); GLM_FUNC_DECL explicit tmat4x2( T const & x); - GLM_FUNC_DECL explicit tmat4x2( + GLM_FUNC_DECL tmat4x2( T const & x0, T const & y0, T const & x1, T const & y1, T const & x2, T const & y2, T const & x3, T const & y3); - GLM_FUNC_DECL explicit tmat4x2( + GLM_FUNC_DECL tmat4x2( col_type const & v0, col_type const & v1, col_type const & v2, col_type const & v3); -#if(GLM_HAS_INITIALIZER_LISTS) - template - GLM_FUNC_DECL tmat4x2(std::initializer_list m); - - GLM_FUNC_DECL tmat4x2(std::initializer_list > m); -#endif//GLM_HAS_INITIALIZER_LISTS - ////////////////////////////////////// // Conversions @@ -92,14 +85,14 @@ namespace detail typename X2, typename Y2, typename X3, typename Y3, typename X4, typename Y4> - GLM_FUNC_DECL explicit tmat4x2( + GLM_FUNC_DECL tmat4x2( X1 const & x1, Y1 const & y1, X2 const & x2, Y2 const & y2, X3 const & x3, Y3 const & y3, X4 const & x4, Y4 const & y4); template - GLM_FUNC_DECL explicit tmat4x2( + GLM_FUNC_DECL tmat4x2( tvec2 const & v1, tvec2 const & v2, tvec2 const & v3, diff --git a/glm/detail/type_mat4x2.inl b/glm/detail/type_mat4x2.inl index 78ed517f..5a212fbd 100644 --- a/glm/detail/type_mat4x2.inl +++ b/glm/detail/type_mat4x2.inl @@ -181,33 +181,6 @@ namespace detail this->value[3] = col_type(v4); } -#if(GLM_HAS_INITIALIZER_LISTS) - template - template - GLM_FUNC_QUALIFIER tmat4x2::tmat4x2(std::initializer_list l) - { - assert(l.size() == this->length() * this->value[0].length()); - - typename std::initializer_list::iterator p = l.begin(); - - this->value[0] = tvec2(*(p + 0), *(p + 1)); - this->value[1] = tvec2(*(p + 2), *(p + 3)); - this->value[2] = tvec2(*(p + 4), *(p + 5)); - this->value[3] = tvec2(*(p + 6), *(p + 7)); - } - - template - GLM_FUNC_QUALIFIER tmat4x2::tmat4x2(std::initializer_list > l) - { - assert(l.size() == this->length()); - - this->value[0] = l.begin()[0]; - this->value[1] = l.begin()[1]; - this->value[2] = l.begin()[2]; - this->value[3] = l.begin()[3]; - } -#endif//GLM_HAS_INITIALIZER_LISTS - ////////////////////////////////////// // Conversion template diff --git a/glm/detail/type_mat4x3.hpp b/glm/detail/type_mat4x3.hpp index 3b7663dd..406dc848 100644 --- a/glm/detail/type_mat4x3.hpp +++ b/glm/detail/type_mat4x3.hpp @@ -66,24 +66,17 @@ namespace detail ctor Null); GLM_FUNC_DECL explicit tmat4x3( T const & x); - GLM_FUNC_DECL explicit tmat4x3( + GLM_FUNC_DECL tmat4x3( T const & x0, T const & y0, T const & z0, T const & x1, T const & y1, T const & z1, T const & x2, T const & y2, T const & z2, T const & x3, T const & y3, T const & z3); - GLM_FUNC_DECL explicit tmat4x3( + GLM_FUNC_DECL tmat4x3( col_type const & v0, col_type const & v1, col_type const & v2, col_type const & v3); -#if(GLM_HAS_INITIALIZER_LISTS) - template - GLM_FUNC_DECL tmat4x3(std::initializer_list m); - - GLM_FUNC_DECL tmat4x3(std::initializer_list > m); -#endif//GLM_HAS_INITIALIZER_LISTS - ////////////////////////////////////// // Conversions @@ -92,14 +85,14 @@ namespace detail typename X2, typename Y2, typename Z2, typename X3, typename Y3, typename Z3, typename X4, typename Y4, typename Z4> - GLM_FUNC_DECL explicit tmat4x3( + GLM_FUNC_DECL tmat4x3( X1 const & x1, Y1 const & y1, Z1 const & z1, X2 const & x2, Y2 const & y2, Z2 const & z2, X3 const & x3, Y3 const & y3, Z3 const & z3, X4 const & x4, Y4 const & y4, Z4 const & z4); template - GLM_FUNC_DECL explicit tmat4x3( + GLM_FUNC_DECL tmat4x3( tvec3 const & v1, tvec3 const & v2, tvec3 const & v3, diff --git a/glm/detail/type_mat4x3.inl b/glm/detail/type_mat4x3.inl index 965604e7..a9694fcd 100644 --- a/glm/detail/type_mat4x3.inl +++ b/glm/detail/type_mat4x3.inl @@ -140,33 +140,6 @@ namespace detail this->value[3] = v3; } -#if(GLM_HAS_INITIALIZER_LISTS) - template - template - GLM_FUNC_QUALIFIER tmat4x3::tmat4x3(std::initializer_list l) - { - assert(l.size() == this->length() * this->value[0].length()); - - typename std::initializer_list::iterator p = l.begin(); - - this->value[0] = tvec3(*(p + 0), *(p + 1), *(p + 2)); - this->value[1] = tvec3(*(p + 3), *(p + 4), *(p + 5)); - this->value[2] = tvec3(*(p + 6), *(p + 7), *(p + 8)); - this->value[3] = tvec3(*(p + 9), *(p + 10), *(p + 11)); - } - - template - GLM_FUNC_QUALIFIER tmat4x3::tmat4x3(std::initializer_list > l) - { - assert(l.size() == this->length()); - - this->value[0] = l.begin()[0]; - this->value[1] = l.begin()[1]; - this->value[2] = l.begin()[2]; - this->value[3] = l.begin()[3]; - } -#endif//GLM_HAS_INITIALIZER_LISTS - ////////////////////////////////////// // Conversion constructors diff --git a/glm/detail/type_mat4x4.hpp b/glm/detail/type_mat4x4.hpp index 2df7f4ae..d6d81007 100644 --- a/glm/detail/type_mat4x4.hpp +++ b/glm/detail/type_mat4x4.hpp @@ -74,24 +74,17 @@ namespace detail ctor Null); GLM_FUNC_DECL explicit tmat4x4( T const & x); - GLM_FUNC_DECL explicit tmat4x4( + GLM_FUNC_DECL tmat4x4( T const & x0, T const & y0, T const & z0, T const & w0, T const & x1, T const & y1, T const & z1, T const & w1, T const & x2, T const & y2, T const & z2, T const & w2, T const & x3, T const & y3, T const & z3, T const & w3); - GLM_FUNC_DECL explicit tmat4x4( + GLM_FUNC_DECL tmat4x4( col_type const & v0, col_type const & v1, col_type const & v2, col_type const & v3); -#if(GLM_HAS_INITIALIZER_LISTS) - template - GLM_FUNC_DECL tmat4x4(std::initializer_list m); - - GLM_FUNC_DECL tmat4x4(std::initializer_list > m); -#endif//GLM_HAS_INITIALIZER_LISTS - ////////////////////////////////////// // Conversions @@ -100,14 +93,14 @@ namespace detail typename X2, typename Y2, typename Z2, typename W2, typename X3, typename Y3, typename Z3, typename W3, typename X4, typename Y4, typename Z4, typename W4> - GLM_FUNC_DECL explicit tmat4x4( + GLM_FUNC_DECL tmat4x4( X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2, X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3, X4 const & x4, Y4 const & y4, Z4 const & z4, W4 const & w4); template - GLM_FUNC_DECL explicit tmat4x4( + GLM_FUNC_DECL tmat4x4( tvec4 const & v1, tvec4 const & v2, tvec4 const & v3, diff --git a/glm/detail/type_mat4x4.inl b/glm/detail/type_mat4x4.inl index 58e6a846..425d5233 100644 --- a/glm/detail/type_mat4x4.inl +++ b/glm/detail/type_mat4x4.inl @@ -162,33 +162,6 @@ namespace detail this->value[3] = col_type(m[3]); } -#if(GLM_HAS_INITIALIZER_LISTS) - template - template - GLM_FUNC_QUALIFIER tmat4x4::tmat4x4(std::initializer_list l) - { - assert(l.size() == this->length() * this->value[0].length()); - - typename std::initializer_list::iterator p = l.begin(); - - this->value[0] = tvec4(*(p + 0), *(p + 1), *(p + 2), *(p + 3)); - this->value[1] = tvec4(*(p + 4), *(p + 5), *(p + 6), *(p + 7)); - this->value[2] = tvec4(*(p + 8), *(p + 9), *(p + 10), *(p + 11)); - this->value[3] = tvec4(*(p + 12), *(p + 13), *(p + 14), *(p + 15)); - } - - template - GLM_FUNC_QUALIFIER tmat4x4::tmat4x4(std::initializer_list > l) - { - assert(l.size() == this->length()); - - this->value[0] = l.begin()[0]; - this->value[1] = l.begin()[1]; - this->value[2] = l.begin()[2]; - this->value[3] = l.begin()[3]; - } -#endif//GLM_HAS_INITIALIZER_LISTS - ////////////////////////////////////// // Conversion constructors template diff --git a/glm/detail/type_vec2.hpp b/glm/detail/type_vec2.hpp index 8dd4cba0..f1de51d4 100644 --- a/glm/detail/type_vec2.hpp +++ b/glm/detail/type_vec2.hpp @@ -107,11 +107,6 @@ namespace detail template GLM_FUNC_DECL tvec2(tvec2 const & v); -#if(GLM_HAS_INITIALIZER_LISTS) - template - GLM_FUNC_DECL tvec2(std::initializer_list const & v); -#endif//GLM_HAS_INITIALIZER_LISTS - ////////////////////////////////////// // Explicit basic constructors @@ -119,7 +114,7 @@ namespace detail ctor); GLM_FUNC_DECL explicit tvec2( T const & s); - GLM_FUNC_DECL explicit tvec2( + GLM_FUNC_DECL tvec2( T const & s1, T const & s2); @@ -139,7 +134,7 @@ namespace detail //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec2( + GLM_FUNC_DECL tvec2( U const & x, V const & y); @@ -148,7 +143,7 @@ namespace detail //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec2(tvec2 const & v); + GLM_FUNC_DECL tvec2(tvec2 const & v); //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec2(tvec3 const & v); diff --git a/glm/detail/type_vec2.inl b/glm/detail/type_vec2.inl index 03857005..0935e59f 100644 --- a/glm/detail/type_vec2.inl +++ b/glm/detail/type_vec2.inl @@ -74,17 +74,6 @@ namespace detail y(v.y) {} -#if(GLM_HAS_INITIALIZER_LISTS) - template - template - GLM_FUNC_QUALIFIER tvec2::tvec2(std::initializer_list const & v) : - x(static_cast(v.begin()[0])), - y(static_cast(v.begin()[1])) - { - assert(v.size() == this->length()); - } -#endif//GLM_HAS_INITIALIZER_LISTS - ////////////////////////////////////// // Explicit basic constructors diff --git a/glm/detail/type_vec3.hpp b/glm/detail/type_vec3.hpp index 5718557a..424ab978 100644 --- a/glm/detail/type_vec3.hpp +++ b/glm/detail/type_vec3.hpp @@ -108,11 +108,6 @@ namespace detail template GLM_FUNC_DECL tvec3(tvec3 const & v); -#if(GLM_HAS_INITIALIZER_LISTS) - template - GLM_FUNC_DECL tvec3(std::initializer_list const & v); -#endif//GLM_HAS_INITIALIZER_LISTS - ////////////////////////////////////// // Explicit basic constructors @@ -120,7 +115,7 @@ namespace detail ctor); GLM_FUNC_DECL explicit tvec3( T const & s); - GLM_FUNC_DECL explicit tvec3( + GLM_FUNC_DECL tvec3( T const & s1, T const & s2, T const & s3); @@ -130,7 +125,7 @@ namespace detail //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec3( + GLM_FUNC_DECL tvec3( U const & x, V const & y, W const & z); diff --git a/glm/detail/type_vec3.inl b/glm/detail/type_vec3.inl index e98201f8..3d186089 100644 --- a/glm/detail/type_vec3.inl +++ b/glm/detail/type_vec3.inl @@ -77,18 +77,6 @@ namespace detail z(v.z) {} -#if(GLM_HAS_INITIALIZER_LISTS) - template - template - GLM_FUNC_QUALIFIER tvec3::tvec3(std::initializer_list const & v) : - x(static_cast(v.begin()[0])), - y(static_cast(v.begin()[1])), - z(static_cast(v.begin()[2])) - { - assert(v.size() == this->length()); - } -#endif//GLM_HAS_INITIALIZER_LISTS - ////////////////////////////////////// // Explicit basic constructors diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index f0b4122a..c9cc8097 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -110,11 +110,6 @@ namespace detail template GLM_FUNC_DECL tvec4(tvec4 const & v); -#if(GLM_HAS_INITIALIZER_LISTS) - template - GLM_FUNC_DECL tvec4(std::initializer_list l); -#endif//GLM_HAS_INITIALIZER_LISTS - ////////////////////////////////////// // Explicit basic constructors @@ -122,7 +117,7 @@ namespace detail ctor); GLM_FUNC_DECL explicit tvec4( T const & s); - GLM_FUNC_DECL explicit tvec4( + GLM_FUNC_DECL tvec4( T const & s0, T const & s1, T const & s2, @@ -133,7 +128,7 @@ namespace detail /// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec4( + GLM_FUNC_DECL tvec4( A const & x, B const & y, C const & z, diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 995652c0..86f1d937 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -80,19 +80,6 @@ namespace detail w(v.w) {} -#if(GLM_HAS_INITIALIZER_LISTS) - template - template - GLM_FUNC_QUALIFIER tvec4::tvec4(std::initializer_list v) : - x(static_cast(v.begin()[0])), - y(static_cast(v.begin()[1])), - z(static_cast(v.begin()[2])), - w(static_cast(v.begin()[3])) - { - assert(v.size() == this->length()); - } -#endif//GLM_HAS_INITIALIZER_LISTS - ////////////////////////////////////// // Explicit basic constructors diff --git a/readme.txt b/readme.txt index 2595eee4..64aed7ce 100644 --- a/readme.txt +++ b/readme.txt @@ -37,8 +37,9 @@ More informations in GLM manual: http://glm.g-truc.net/glm.pdf ================================================================================ -GLM 0.9.5.2: 2014-0X-XX +GLM 0.9.5.2: 2014-02-08 -------------------------------------------------------------------------------- +- Fixed initializer list ambiguity (#159, #160) - Fixed warnings with the Android NDK 9c - Fixed non power of two matrix products - Fixed mix function link error diff --git a/test/core/core_type_mat4x4.cpp b/test/core/core_type_mat4x4.cpp index b2dad8e2..9f72363a 100644 --- a/test/core/core_type_mat4x4.cpp +++ b/test/core/core_type_mat4x4.cpp @@ -189,6 +189,19 @@ int test_ctr() { int Error(0); + { + glm::vec4 V{0, 1, 2, 3}; + + glm::mat4 M{ + {0, 1, 2, 3}, + {4, 5, 6, 7}, + {8, 9, 10, 11}, + {12, 13, 14, 15}}; + } + + glm::mat4 m4{ + {0, 1, 2, 3}}; + #if(GLM_HAS_INITIALIZER_LISTS) glm::mat4 m0( glm::vec4(0, 1, 2, 3),