From ce644e01bb532199abec3466f53378623071f9f0 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Tue, 10 Jul 2018 19:01:09 +0200 Subject: [PATCH] Removed useless copy assignment operators --- glm/detail/type_mat2x2.hpp | 2 -- glm/detail/type_mat2x2.inl | 8 -------- glm/detail/type_mat2x3.hpp | 2 -- glm/detail/type_mat2x3.inl | 8 -------- glm/detail/type_mat2x4.hpp | 2 -- glm/detail/type_mat2x4.inl | 8 -------- glm/detail/type_mat3x2.hpp | 2 -- glm/detail/type_mat3x2.inl | 15 +++----------- glm/detail/type_mat3x3.hpp | 2 -- glm/detail/type_mat3x3.inl | 41 ++++++++++---------------------------- glm/detail/type_mat3x4.hpp | 2 -- glm/detail/type_mat3x4.inl | 9 --------- glm/detail/type_mat4x2.hpp | 2 -- glm/detail/type_mat4x2.inl | 10 ---------- glm/detail/type_mat4x3.hpp | 2 -- glm/detail/type_mat4x3.inl | 10 ---------- glm/detail/type_mat4x4.hpp | 2 -- glm/detail/type_mat4x4.inl | 12 ----------- 18 files changed, 14 insertions(+), 125 deletions(-) diff --git a/glm/detail/type_mat2x2.hpp b/glm/detail/type_mat2x2.hpp index dd2896a1..40a9712f 100644 --- a/glm/detail/type_mat2x2.hpp +++ b/glm/detail/type_mat2x2.hpp @@ -74,8 +74,6 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<2, 2, T, Q> & operator=(mat<2, 2, T, Q> const& v); - template GLM_FUNC_DECL mat<2, 2, T, Q> & operator=(mat<2, 2, U, Q> const& m); template diff --git a/glm/detail/type_mat2x2.inl b/glm/detail/type_mat2x2.inl index 2ed6d1ce..04c0b54c 100644 --- a/glm/detail/type_mat2x2.inl +++ b/glm/detail/type_mat2x2.inl @@ -235,14 +235,6 @@ namespace glm // -- Unary updatable operators -- - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator=(mat<2, 2, T, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } - template template GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator=(mat<2, 2, U, Q> const& m) diff --git a/glm/detail/type_mat2x3.hpp b/glm/detail/type_mat2x3.hpp index 55f47fd7..bff2da83 100644 --- a/glm/detail/type_mat2x3.hpp +++ b/glm/detail/type_mat2x3.hpp @@ -75,8 +75,6 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<2, 3, T, Q> & operator=(mat<2, 3, T, Q> const& m); - template GLM_FUNC_DECL mat<2, 3, T, Q> & operator=(mat<2, 3, U, Q> const& m); template diff --git a/glm/detail/type_mat2x3.inl b/glm/detail/type_mat2x3.inl index c2935a59..ed56585a 100644 --- a/glm/detail/type_mat2x3.inl +++ b/glm/detail/type_mat2x3.inl @@ -235,14 +235,6 @@ namespace glm // -- Unary updatable operators -- - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator=(mat<2, 3, T, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } - template template GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator=(mat<2, 3, U, Q> const& m) diff --git a/glm/detail/type_mat2x4.hpp b/glm/detail/type_mat2x4.hpp index c3a6e1da..4732ffd0 100644 --- a/glm/detail/type_mat2x4.hpp +++ b/glm/detail/type_mat2x4.hpp @@ -77,8 +77,6 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<2, 4, T, Q> & operator=(mat<2, 4, T, Q> const& m); - template GLM_FUNC_DECL mat<2, 4, T, Q> & operator=(mat<2, 4, U, Q> const& m); template diff --git a/glm/detail/type_mat2x4.inl b/glm/detail/type_mat2x4.inl index ed4c74e5..463b0ed9 100644 --- a/glm/detail/type_mat2x4.inl +++ b/glm/detail/type_mat2x4.inl @@ -237,14 +237,6 @@ namespace glm // -- Unary updatable operators -- - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator=(mat<2, 4, T, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } - template template GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator=(mat<2, 4, U, Q> const& m) diff --git a/glm/detail/type_mat3x2.hpp b/glm/detail/type_mat3x2.hpp index 15fa31c2..1b3edc3d 100644 --- a/glm/detail/type_mat3x2.hpp +++ b/glm/detail/type_mat3x2.hpp @@ -82,8 +82,6 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<3, 2, T, Q> & operator=(mat<3, 2, T, Q> const& m); - template GLM_FUNC_DECL mat<3, 2, T, Q> & operator=(mat<3, 2, U, Q> const& m); template diff --git a/glm/detail/type_mat3x2.inl b/glm/detail/type_mat3x2.inl index 73379964..3468e661 100644 --- a/glm/detail/type_mat3x2.inl +++ b/glm/detail/type_mat3x2.inl @@ -96,9 +96,9 @@ namespace glm # endif { # if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x1, y1); - this->value[1] = col_type(x2, y2); - this->value[2] = col_type(x3, y3); + this->value[0] = col_type(x0, y0); + this->value[1] = col_type(x1, y1); + this->value[2] = col_type(x2, y2); # endif } @@ -254,15 +254,6 @@ namespace glm // -- Unary updatable operators -- - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator=(mat<3, 2, T, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } - template template GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator=(mat<3, 2, U, Q> const& m) diff --git a/glm/detail/type_mat3x3.hpp b/glm/detail/type_mat3x3.hpp index 83941032..310ecba2 100644 --- a/glm/detail/type_mat3x3.hpp +++ b/glm/detail/type_mat3x3.hpp @@ -81,8 +81,6 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<3, 3, T, Q> & operator=(mat<3, 3, T, Q> const& m); - template GLM_FUNC_DECL mat<3, 3, T, Q> & operator=(mat<3, 3, U, Q> const& m); template diff --git a/glm/detail/type_mat3x3.inl b/glm/detail/type_mat3x3.inl index 9f30b70b..456f6945 100644 --- a/glm/detail/type_mat3x3.inl +++ b/glm/detail/type_mat3x3.inl @@ -37,15 +37,15 @@ namespace glm } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 3, T, Q>::mat(T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 3, T, Q>::mat(T s) # if GLM_HAS_INITIALIZER_LISTS - : value{col_type(scalar, 0, 0), col_type(0, scalar, 0), col_type(0, 0, scalar)} + : value{col_type(s, 0, 0), col_type(0, s, 0), col_type(0, 0, s)} # endif { # if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(scalar, 0, 0); - this->value[1] = col_type(0, scalar, 0); - this->value[2] = col_type(0, 0, scalar); + this->value[0] = col_type(s, 0, 0); + this->value[1] = col_type(0, s, 0); + this->value[2] = col_type(0, 0, s); # endif } @@ -68,12 +68,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 3, T, Q>::mat - ( - col_type const& v0, - col_type const& v1, - col_type const& v2 - ) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 3, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2) # if GLM_HAS_INITIALIZER_LISTS : value{col_type(v0), col_type(v1), col_type(v2)} # endif @@ -99,24 +94,19 @@ namespace glm X3 x3, Y3 y3, Z3 z3 ) # if GLM_HAS_INITIALIZER_LISTS - : value{col_type(static_cast(x1), static_cast(y1), static_cast(z1)), col_type(static_cast(x2), static_cast(y2), static_cast(z2)), col_type(static_cast(x3), static_cast(y3), static_cast(z3))} + : value{col_type(x1, y1, z1), col_type(x2, y2, z2), col_type(x3, y3, z3)} # endif { # if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(static_cast(x1), static_cast(y1), static_cast(z1)); - this->value[1] = col_type(static_cast(x2), static_cast(y2), static_cast(z2)); - this->value[2] = col_type(static_cast(x3), static_cast(y3), static_cast(z3)); + this->value[0] = col_type(x1, y1, z1); + this->value[1] = col_type(x2, y2, z2); + this->value[2] = col_type(x3, y3, z3); # endif } template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 3, T, Q>::mat - ( - vec<3, V1, Q> const& v1, - vec<3, V2, Q> const& v2, - vec<3, V3, Q> const& v3 - ) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 3, T, Q>::mat(vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2, vec<3, V3, Q> const& v3) # if GLM_HAS_INITIALIZER_LISTS : value{col_type(v1), col_type(v2), col_type(v3)} # endif @@ -266,15 +256,6 @@ namespace glm // -- Unary updatable operators -- - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator=(mat<3, 3, T, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } - template template GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator=(mat<3, 3, U, Q> const& m) diff --git a/glm/detail/type_mat3x4.hpp b/glm/detail/type_mat3x4.hpp index ef415423..d383de45 100644 --- a/glm/detail/type_mat3x4.hpp +++ b/glm/detail/type_mat3x4.hpp @@ -82,8 +82,6 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<3, 4, T, Q> & operator=(mat<3, 4, T, Q> const& m); - template GLM_FUNC_DECL mat<3, 4, T, Q> & operator=(mat<3, 4, U, Q> const& m); template diff --git a/glm/detail/type_mat3x4.inl b/glm/detail/type_mat3x4.inl index 0d9caba8..8d84fcba 100644 --- a/glm/detail/type_mat3x4.inl +++ b/glm/detail/type_mat3x4.inl @@ -260,15 +260,6 @@ namespace glm // -- Unary updatable operators -- - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator=(mat<3, 4, T, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } - template template GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator=(mat<3, 4, U, Q> const& m) diff --git a/glm/detail/type_mat4x2.hpp b/glm/detail/type_mat4x2.hpp index 9aa0fe2e..2fba173d 100644 --- a/glm/detail/type_mat4x2.hpp +++ b/glm/detail/type_mat4x2.hpp @@ -87,8 +87,6 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<4, 2, T, Q> & operator=(mat<4, 2, T, Q> const& m); - template GLM_FUNC_DECL mat<4, 2, T, Q> & operator=(mat<4, 2, U, Q> const& m); template diff --git a/glm/detail/type_mat4x2.inl b/glm/detail/type_mat4x2.inl index 0d396a0d..a108266e 100644 --- a/glm/detail/type_mat4x2.inl +++ b/glm/detail/type_mat4x2.inl @@ -273,16 +273,6 @@ namespace glm // -- Unary updatable operators -- - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q>& mat<4, 2, T, Q>::operator=(mat<4, 2, T, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } - template template GLM_FUNC_QUALIFIER mat<4, 2, T, Q>& mat<4, 2, T, Q>::operator=(mat<4, 2, U, Q> const& m) diff --git a/glm/detail/type_mat4x3.hpp b/glm/detail/type_mat4x3.hpp index 3d12a957..06291e68 100644 --- a/glm/detail/type_mat4x3.hpp +++ b/glm/detail/type_mat4x3.hpp @@ -87,8 +87,6 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<4, 3, T, Q> & operator=(mat<4, 3, T, Q> const& m); - template GLM_FUNC_DECL mat<4, 3, T, Q> & operator=(mat<4, 3, U, Q> const& m); template diff --git a/glm/detail/type_mat4x3.inl b/glm/detail/type_mat4x3.inl index 64001a77..c6771c3c 100644 --- a/glm/detail/type_mat4x3.inl +++ b/glm/detail/type_mat4x3.inl @@ -273,16 +273,6 @@ namespace glm // -- Unary updatable operators -- - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q>& mat<4, 3, T, Q>::operator=(mat<4, 3, T, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } - template template GLM_FUNC_QUALIFIER mat<4, 3, T, Q>& mat<4, 3, T, Q>::operator=(mat<4, 3, U, Q> const& m) diff --git a/glm/detail/type_mat4x4.hpp b/glm/detail/type_mat4x4.hpp index e50aa48b..ac1cf58b 100644 --- a/glm/detail/type_mat4x4.hpp +++ b/glm/detail/type_mat4x4.hpp @@ -86,8 +86,6 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL mat<4, 4, T, Q> & operator=(mat<4, 4, T, Q> const& m); - template GLM_FUNC_DECL mat<4, 4, T, Q> & operator=(mat<4, 4, U, Q> const& m); template diff --git a/glm/detail/type_mat4x4.inl b/glm/detail/type_mat4x4.inl index 3a9c5fec..96cb9786 100644 --- a/glm/detail/type_mat4x4.inl +++ b/glm/detail/type_mat4x4.inl @@ -304,18 +304,6 @@ namespace glm // -- Unary arithmetic operators -- - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator=(mat<4, 4, T, Q> const& m) - { - //memcpy could be faster - //memcpy(&this->value, &m.value, 16 * sizeof(valType)); - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } - template template GLM_FUNC_QUALIFIER mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator=(mat<4, 4, U, Q> const& m)