From 812ff4fcc836f61a59aaae753eb43108d164ec76 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 30 Sep 2013 02:36:04 +0200 Subject: [PATCH] Initializer list experiment --- glm/core/type_mat4x4.inl | 16 ++++++++-------- test/core/core_type_mat4x4.cpp | 11 ++++++----- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/glm/core/type_mat4x4.inl b/glm/core/type_mat4x4.inl index e45cccc3..28045567 100644 --- a/glm/core/type_mat4x4.inl +++ b/glm/core/type_mat4x4.inl @@ -181,20 +181,20 @@ namespace detail { assert(m.size() >= this->length()); - this->value[0] = static_cast >(reinterpret_cast&>(const_cast(m.begin()[0]))); - this->value[1] = static_cast >(reinterpret_cast&>(const_cast(m.begin()[4]))); - this->value[2] = static_cast >(reinterpret_cast&>(const_cast(m.begin()[8]))); - this->value[3] = static_cast >(reinterpret_cast&>(const_cast(m.begin()[12]))); + this->value[0] = reinterpret_cast const &>(m.begin()[0]); + this->value[1] = reinterpret_cast const &>(m.begin()[4]); + this->value[2] = reinterpret_cast const &>(m.begin()[8]); + this->value[3] = reinterpret_cast const &>(m.begin()[12]); } template template GLM_FUNC_QUALIFIER tmat4x4::tmat4x4(std::initializer_list > const & m) { - this->value[0] = static_cast >(m.begin()[0]); - this->value[1] = static_cast >(m.begin()[1]); - this->value[2] = static_cast >(m.begin()[2]); - this->value[3] = static_cast >(m.begin()[3]); + this->value[0] = m.begin()[0]; + this->value[1] = m.begin()[1]; + this->value[2] = m.begin()[2]; + this->value[3] = m.begin()[3]; } #endif//GLM_HAS_INITIALIZER_LISTS diff --git a/test/core/core_type_mat4x4.cpp b/test/core/core_type_mat4x4.cpp index 9801e1a6..2b443756 100644 --- a/test/core/core_type_mat4x4.cpp +++ b/test/core/core_type_mat4x4.cpp @@ -131,17 +131,18 @@ int test_ctr() glm::mat4 m1{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; glm::mat4 m2{ - {0, 1, 2, 3}, - {4, 5, 6, 7}, - {8, 9, 10, 11}, - {12, 13, 14, 15}}; + glm::vec4{0, 1, 2, 3}, + glm::vec4{4, 5, 6, 7}, + glm::vec4{8, 9, 10, 11}, + glm::vec4{12, 13, 14, 15}}; +/* std::initializer_list m3{ {0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}, {12, 13, 14, 15}}; - +*/ //glm::mat4 m4{m3}; /*