diff --git a/glm/detail/func_integer.inl b/glm/detail/func_integer.inl index e76b2384..ccdb5641 100644 --- a/glm/detail/func_integer.inl +++ b/glm/detail/func_integer.inl @@ -44,7 +44,7 @@ namespace detail { GLM_FUNC_QUALIFIER int mask(int Bits) { - return ~((~0) << Bits); + return Bits >= 32 ? 0xffffffff : (static_cast(1) << Bits) - static_cast(1); } template diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 78dd193a..578e95ed 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -527,6 +527,10 @@ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46)) || \ __has_feature(cxx_range_for)) +#define GLM_HAS_ASSIGNABLE ( \ + (GLM_LANG & GLM_LANG_CXX11_FLAG) || \ + ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC49))) + // OpenMP #ifdef _OPENMP # if GLM_COMPILER & GLM_COMPILER_GCC diff --git a/glm/detail/type_mat2x2.hpp b/glm/detail/type_mat2x2.hpp index c17fdc9c..b4cb89d5 100644 --- a/glm/detail/type_mat2x2.hpp +++ b/glm/detail/type_mat2x2.hpp @@ -66,7 +66,6 @@ namespace glm ////////////////////////////////////// // Constructors GLM_FUNC_DECL tmat2x2(); - GLM_FUNC_DECL tmat2x2(tmat2x2 const & m); template GLM_FUNC_DECL tmat2x2(tmat2x2 const & m); @@ -111,7 +110,6 @@ namespace glm GLM_FUNC_DECL col_type & operator[](length_t i); GLM_FUNC_DECL col_type const & operator[](length_t i) const; - GLM_FUNC_DECL tmat2x2 & operator=(tmat2x2 const & m); template GLM_FUNC_DECL tmat2x2 & operator=(tmat2x2 const & m); template diff --git a/glm/detail/type_mat2x2.inl b/glm/detail/type_mat2x2.inl index df56aac6..95c88c9e 100644 --- a/glm/detail/type_mat2x2.inl +++ b/glm/detail/type_mat2x2.inl @@ -89,13 +89,6 @@ namespace detail # endif } - template - GLM_FUNC_QUALIFIER tmat2x2::tmat2x2(tmat2x2 const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - } - template template GLM_FUNC_QUALIFIER tmat2x2::tmat2x2(tmat2x2 const & m) @@ -225,15 +218,6 @@ namespace detail ////////////////////////////////////////////////////////////// // mat2x2 operators - // This function shouldn't required but it seems that VC7.1 have an optimisation bug if this operator wasn't declared - template - GLM_FUNC_QUALIFIER tmat2x2& tmat2x2::operator=(tmat2x2 const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } - template template GLM_FUNC_QUALIFIER tmat2x2& tmat2x2::operator=(tmat2x2 const & m) diff --git a/glm/detail/type_mat2x3.hpp b/glm/detail/type_mat2x3.hpp index f60282d3..53c5fa4a 100644 --- a/glm/detail/type_mat2x3.hpp +++ b/glm/detail/type_mat2x3.hpp @@ -61,7 +61,6 @@ namespace glm public: // Constructors GLM_FUNC_DECL tmat2x3(); - GLM_FUNC_DECL tmat2x3(tmat2x3 const & m); template GLM_FUNC_DECL tmat2x3(tmat2x3 const & m); @@ -104,7 +103,6 @@ namespace glm GLM_FUNC_DECL col_type & operator[](length_t i); GLM_FUNC_DECL col_type const & operator[](length_t i) const; - GLM_FUNC_DECL tmat2x3 & operator= (tmat2x3 const & m); template GLM_FUNC_DECL tmat2x3 & operator= (tmat2x3 const & m); template diff --git a/glm/detail/type_mat2x3.inl b/glm/detail/type_mat2x3.inl index 1ed527b5..64813c15 100644 --- a/glm/detail/type_mat2x3.inl +++ b/glm/detail/type_mat2x3.inl @@ -71,13 +71,6 @@ namespace glm # endif } - template - GLM_FUNC_QUALIFIER tmat2x3::tmat2x3(tmat2x3 const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - } - template template GLM_FUNC_QUALIFIER tmat2x3::tmat2x3(tmat2x3 const & m) @@ -210,15 +203,7 @@ namespace glm // Unary updatable operators template - GLM_FUNC_QUALIFIER tmat2x3& tmat2x3::operator=(tmat2x3 const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } - - template - template + template GLM_FUNC_QUALIFIER tmat2x3& tmat2x3::operator=(tmat2x3 const & m) { this->value[0] = m[0]; @@ -226,8 +211,8 @@ namespace glm return *this; } - template - template + template + template GLM_FUNC_QUALIFIER tmat2x3 & tmat2x3::operator+=(U s) { this->value[0] += s; @@ -235,8 +220,8 @@ namespace glm return *this; } - template - template + template + template GLM_FUNC_QUALIFIER tmat2x3& tmat2x3::operator+=(tmat2x3 const & m) { this->value[0] += m[0]; @@ -244,8 +229,8 @@ namespace glm return *this; } - template - template + template + template GLM_FUNC_QUALIFIER tmat2x3& tmat2x3::operator-=(U s) { this->value[0] -= s; @@ -253,8 +238,8 @@ namespace glm return *this; } - template - template + template + template GLM_FUNC_QUALIFIER tmat2x3& tmat2x3::operator-=(tmat2x3 const & m) { this->value[0] -= m[0]; @@ -262,8 +247,8 @@ namespace glm return *this; } - template - template + template + template GLM_FUNC_QUALIFIER tmat2x3& tmat2x3::operator*=(U s) { this->value[0] *= s; @@ -272,7 +257,7 @@ namespace glm } template - template + template GLM_FUNC_QUALIFIER tmat2x3 & tmat2x3::operator/=(U s) { this->value[0] /= s; @@ -280,7 +265,7 @@ namespace glm return *this; } - template + template GLM_FUNC_QUALIFIER tmat2x3 & tmat2x3::operator++() { ++this->value[0]; @@ -288,7 +273,7 @@ namespace glm return *this; } - template + template GLM_FUNC_QUALIFIER tmat2x3 & tmat2x3::operator--() { --this->value[0]; diff --git a/glm/detail/type_mat2x4.hpp b/glm/detail/type_mat2x4.hpp index 28066c04..a30929da 100644 --- a/glm/detail/type_mat2x4.hpp +++ b/glm/detail/type_mat2x4.hpp @@ -61,7 +61,6 @@ namespace glm public: // Constructors GLM_FUNC_DECL tmat2x4(); - GLM_FUNC_DECL tmat2x4(tmat2x4 const & m); template GLM_FUNC_DECL tmat2x4(tmat2x4 const & m); @@ -106,7 +105,6 @@ namespace glm GLM_FUNC_DECL col_type & operator[](length_t i); GLM_FUNC_DECL col_type const & operator[](length_t i) const; - GLM_FUNC_DECL tmat2x4& operator= (tmat2x4 const & m); template GLM_FUNC_DECL tmat2x4& operator= (tmat2x4 const & m); template diff --git a/glm/detail/type_mat2x4.inl b/glm/detail/type_mat2x4.inl index e45ffc0d..94b46140 100644 --- a/glm/detail/type_mat2x4.inl +++ b/glm/detail/type_mat2x4.inl @@ -71,13 +71,6 @@ namespace glm # endif } - template - GLM_FUNC_QUALIFIER tmat2x4::tmat2x4(tmat2x4 const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - } - template template GLM_FUNC_QUALIFIER tmat2x4::tmat2x4(tmat2x4 const & m) @@ -210,14 +203,6 @@ namespace glm ////////////////////////////////////////////////////////////// // Unary updatable operators - template - GLM_FUNC_QUALIFIER tmat2x4& tmat2x4::operator=(tmat2x4 const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } - template template GLM_FUNC_QUALIFIER tmat2x4& tmat2x4::operator=(tmat2x4 const & m) diff --git a/glm/detail/type_mat3x2.hpp b/glm/detail/type_mat3x2.hpp index a09dca98..762158bc 100644 --- a/glm/detail/type_mat3x2.hpp +++ b/glm/detail/type_mat3x2.hpp @@ -61,7 +61,6 @@ namespace glm public: // Constructors GLM_FUNC_DECL tmat3x2(); - GLM_FUNC_DECL tmat3x2(tmat3x2 const & m); template GLM_FUNC_DECL tmat3x2(tmat3x2 const & m); @@ -110,7 +109,6 @@ namespace glm GLM_FUNC_DECL col_type & operator[](length_t i); GLM_FUNC_DECL col_type const & operator[](length_t i) const; - GLM_FUNC_DECL tmat3x2 & operator= (tmat3x2 const & m); template GLM_FUNC_DECL tmat3x2 & operator= (tmat3x2 const & m); template diff --git a/glm/detail/type_mat3x2.inl b/glm/detail/type_mat3x2.inl index 026261dd..956bc866 100644 --- a/glm/detail/type_mat3x2.inl +++ b/glm/detail/type_mat3x2.inl @@ -72,14 +72,6 @@ namespace glm # endif } - template - GLM_FUNC_QUALIFIER tmat3x2::tmat3x2(tmat3x2 const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - } - template template GLM_FUNC_QUALIFIER tmat3x2::tmat3x2(tmat3x2 const & m) @@ -239,15 +231,6 @@ namespace glm ////////////////////////////////////////////////////////////// // Unary updatable operators - template - GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator=(tmat3x2 const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } - template template GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator=(tmat3x2 const & m) diff --git a/glm/detail/type_mat3x3.hpp b/glm/detail/type_mat3x3.hpp index d85ea5aa..a7d1409f 100644 --- a/glm/detail/type_mat3x3.hpp +++ b/glm/detail/type_mat3x3.hpp @@ -65,7 +65,6 @@ namespace glm public: // Constructors GLM_FUNC_DECL tmat3x3(); - GLM_FUNC_DECL tmat3x3(tmat3x3 const & m); template GLM_FUNC_DECL tmat3x3(tmat3x3 const & m); @@ -114,7 +113,6 @@ namespace glm GLM_FUNC_DECL col_type & operator[](length_t i); GLM_FUNC_DECL col_type const & operator[](length_t i) const; - GLM_FUNC_DECL tmat3x3& operator= (tmat3x3 const & m); template GLM_FUNC_DECL tmat3x3& operator= (tmat3x3 const & m); template diff --git a/glm/detail/type_mat3x3.inl b/glm/detail/type_mat3x3.inl index f39baa7d..5fd41d0f 100644 --- a/glm/detail/type_mat3x3.inl +++ b/glm/detail/type_mat3x3.inl @@ -96,14 +96,6 @@ namespace detail # endif } - template - GLM_FUNC_QUALIFIER tmat3x3::tmat3x3(tmat3x3 const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - } - template GLM_FUNC_QUALIFIER tmat3x3::tmat3x3(ctor) {} @@ -263,15 +255,6 @@ namespace detail ////////////////////////////////////////////////////////////// // Operators - template - GLM_FUNC_QUALIFIER tmat3x3 & tmat3x3::operator=(tmat3x3 const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } - template template GLM_FUNC_QUALIFIER tmat3x3 & tmat3x3::operator=(tmat3x3 const & m) diff --git a/glm/detail/type_mat3x4.hpp b/glm/detail/type_mat3x4.hpp index c7017704..6c4c7cd5 100644 --- a/glm/detail/type_mat3x4.hpp +++ b/glm/detail/type_mat3x4.hpp @@ -61,7 +61,6 @@ namespace glm public: // Constructors GLM_FUNC_DECL tmat3x4(); - GLM_FUNC_DECL tmat3x4(tmat3x4 const & m); template GLM_FUNC_DECL tmat3x4(tmat3x4 const & m); @@ -110,7 +109,6 @@ namespace glm GLM_FUNC_DECL col_type & operator[](length_t i); GLM_FUNC_DECL col_type const & operator[](length_t i) const; - GLM_FUNC_DECL tmat3x4 & operator=(tmat3x4 const & m); template GLM_FUNC_DECL tmat3x4 & operator=(tmat3x4 const & m); template diff --git a/glm/detail/type_mat3x4.inl b/glm/detail/type_mat3x4.inl index cb3fdd39..a8ff77d8 100644 --- a/glm/detail/type_mat3x4.inl +++ b/glm/detail/type_mat3x4.inl @@ -72,14 +72,6 @@ namespace glm # endif } - template - GLM_FUNC_QUALIFIER tmat3x4::tmat3x4(tmat3x4 const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - } - template template GLM_FUNC_QUALIFIER tmat3x4::tmat3x4(tmat3x4 const & m) @@ -238,15 +230,6 @@ namespace glm ////////////////////////////////////////////////////////////// // Unary updatable operators - template - GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator=(tmat3x4 const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } - template template GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator=(tmat3x4 const & m) diff --git a/glm/detail/type_mat4x2.hpp b/glm/detail/type_mat4x2.hpp index 27097298..a84c83f2 100644 --- a/glm/detail/type_mat4x2.hpp +++ b/glm/detail/type_mat4x2.hpp @@ -61,7 +61,6 @@ namespace glm public: // Constructors GLM_FUNC_DECL tmat4x2(); - GLM_FUNC_DECL tmat4x2(tmat4x2 const & m); template GLM_FUNC_DECL tmat4x2(tmat4x2 const & m); @@ -116,7 +115,6 @@ namespace glm GLM_FUNC_DECL col_type & operator[](length_t i); GLM_FUNC_DECL col_type const & operator[](length_t i) const; - GLM_FUNC_DECL tmat4x2& operator=(tmat4x2 const & m); template GLM_FUNC_DECL tmat4x2& operator=(tmat4x2 const & m); template diff --git a/glm/detail/type_mat4x2.inl b/glm/detail/type_mat4x2.inl index 3090a8bd..b81bd747 100644 --- a/glm/detail/type_mat4x2.inl +++ b/glm/detail/type_mat4x2.inl @@ -73,15 +73,6 @@ namespace glm # endif } - template - GLM_FUNC_QUALIFIER tmat4x2::tmat4x2(tmat4x2 const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - this->value[3] = m.value[3]; - } - template template GLM_FUNC_QUALIFIER tmat4x2::tmat4x2(tmat4x2 const & m) @@ -262,16 +253,6 @@ namespace glm ////////////////////////////////////////////////////////////// // Unary updatable operators - template - GLM_FUNC_QUALIFIER tmat4x2& tmat4x2::operator=(tmat4x2 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 tmat4x2& tmat4x2::operator=(tmat4x2 const & m) diff --git a/glm/detail/type_mat4x3.hpp b/glm/detail/type_mat4x3.hpp index ad7f015f..f108052b 100644 --- a/glm/detail/type_mat4x3.hpp +++ b/glm/detail/type_mat4x3.hpp @@ -60,7 +60,6 @@ namespace glm public: // Constructors GLM_FUNC_DECL tmat4x3(); - GLM_FUNC_DECL tmat4x3(tmat4x3 const & m); template GLM_FUNC_DECL tmat4x3(tmat4x3 const & m); @@ -115,7 +114,6 @@ namespace glm GLM_FUNC_DECL col_type & operator[](size_type i); GLM_FUNC_DECL col_type const & operator[](size_type i) const; - GLM_FUNC_DECL tmat4x3 & operator=(tmat4x3 const & m); template GLM_FUNC_DECL tmat4x3 & operator=(tmat4x3 const & m); template diff --git a/glm/detail/type_mat4x3.inl b/glm/detail/type_mat4x3.inl index 8ac1a3c6..dd49c231 100644 --- a/glm/detail/type_mat4x3.inl +++ b/glm/detail/type_mat4x3.inl @@ -73,15 +73,6 @@ namespace glm # endif } - template - GLM_FUNC_QUALIFIER tmat4x3::tmat4x3(tmat4x3 const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - this->value[3] = m.value[3]; - } - template template GLM_FUNC_QUALIFIER tmat4x3::tmat4x3(tmat4x3 const & m) @@ -262,16 +253,6 @@ namespace glm ////////////////////////////////////////////////////////////// // Unary updatable operators - template - GLM_FUNC_QUALIFIER tmat4x3& tmat4x3::operator=(tmat4x3 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 tmat4x3& tmat4x3::operator=(tmat4x3 const & m) diff --git a/glm/detail/type_mat4x4.hpp b/glm/detail/type_mat4x4.hpp index cdbfd3d4..61e4e7bb 100644 --- a/glm/detail/type_mat4x4.hpp +++ b/glm/detail/type_mat4x4.hpp @@ -65,7 +65,7 @@ namespace glm public: // Constructors GLM_FUNC_DECL tmat4x4(); - GLM_FUNC_DECL tmat4x4(tmat4x4 const & m); + //GLM_FUNC_DECL tmat4x4(tmat4x4 const & m); template GLM_FUNC_DECL tmat4x4(tmat4x4 const & m); @@ -120,7 +120,7 @@ namespace glm GLM_FUNC_DECL col_type & operator[](length_t i); GLM_FUNC_DECL col_type const & operator[](length_t i) const; - GLM_FUNC_DECL tmat4x4 & operator=(tmat4x4 const & m); + //GLM_FUNC_DECL tmat4x4 & operator=(tmat4x4 const & m); template GLM_FUNC_DECL tmat4x4 & operator=(tmat4x4 const & m); template diff --git a/glm/detail/type_mat4x4.inl b/glm/detail/type_mat4x4.inl index 3b488eff..6a1a0cd2 100644 --- a/glm/detail/type_mat4x4.inl +++ b/glm/detail/type_mat4x4.inl @@ -132,15 +132,6 @@ namespace detail this->value[3] = col_type(0, 0, 0, 1); # endif } - - template - GLM_FUNC_QUALIFIER tmat4x4::tmat4x4(tmat4x4 const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - } template template @@ -348,18 +339,6 @@ namespace detail ////////////////////////////////////////////////////////////// // Operators - template - GLM_FUNC_QUALIFIER tmat4x4& tmat4x4::operator=(tmat4x4 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 tmat4x4& tmat4x4::operator=(tmat4x4 const & m) diff --git a/glm/detail/type_vec1.hpp b/glm/detail/type_vec1.hpp index ab8db882..ba6372d3 100644 --- a/glm/detail/type_vec1.hpp +++ b/glm/detail/type_vec1.hpp @@ -102,7 +102,6 @@ namespace glm // Implicit basic constructors GLM_FUNC_DECL tvec1(); - GLM_FUNC_DECL tvec1(tvec1 const & v); template GLM_FUNC_DECL tvec1(tvec1 const & v); @@ -142,8 +141,6 @@ namespace glm ////////////////////////////////////// // Unary arithmetic operators - GLM_FUNC_DECL tvec1 & operator=(tvec1 const & v); - template GLM_FUNC_DECL tvec1 & operator=(tvec1 const & v); template diff --git a/glm/detail/type_vec1.inl b/glm/detail/type_vec1.inl index d4c5cff2..6932c6dd 100644 --- a/glm/detail/type_vec1.inl +++ b/glm/detail/type_vec1.inl @@ -69,11 +69,6 @@ namespace glm # endif {} - template - GLM_FUNC_QUALIFIER tvec1::tvec1(tvec1 const & v) - : x(v.x) - {} - template template GLM_FUNC_QUALIFIER tvec1::tvec1(tvec1 const & v) @@ -122,13 +117,6 @@ namespace glm ////////////////////////////////////// // Unary arithmetic operators - template - GLM_FUNC_QUALIFIER tvec1 & tvec1::operator=(tvec1 const & v) - { - this->x = v.x; - return *this; - } - template template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator=(tvec1 const & v) diff --git a/glm/detail/type_vec2.hpp b/glm/detail/type_vec2.hpp index 5817a2f6..e3d77690 100644 --- a/glm/detail/type_vec2.hpp +++ b/glm/detail/type_vec2.hpp @@ -104,7 +104,6 @@ namespace glm // Implicit basic constructors GLM_FUNC_DECL tvec2(); - GLM_FUNC_DECL tvec2(tvec2 const & v); template GLM_FUNC_DECL tvec2(tvec2 const & v); @@ -151,8 +150,6 @@ namespace glm ////////////////////////////////////// // Unary arithmetic operators - GLM_FUNC_DECL tvec2 & operator=(tvec2 const & v); - template GLM_FUNC_DECL tvec2 & operator=(tvec2 const & v); template diff --git a/glm/detail/type_vec2.inl b/glm/detail/type_vec2.inl index 7c5eb0b9..9a2326a8 100644 --- a/glm/detail/type_vec2.inl +++ b/glm/detail/type_vec2.inl @@ -64,16 +64,11 @@ namespace glm template GLM_FUNC_QUALIFIER tvec2::tvec2() -# ifndef GLM_FORCE_NO_CTOR_INIT +# ifndef GLM_FORCE_NO_CTOR_INIT : x(0), y(0) # endif {} - template - GLM_FUNC_QUALIFIER tvec2::tvec2(tvec2 const & v) - : x(v.x), y(v.y) - {} - template template GLM_FUNC_QUALIFIER tvec2::tvec2(tvec2 const & v) @@ -141,14 +136,6 @@ namespace glm ////////////////////////////////////// // Unary arithmetic operators - template - GLM_FUNC_QUALIFIER tvec2 & tvec2::operator=(tvec2 const & v) - { - this->x = v.x; - this->y = v.y; - return *this; - } - template template GLM_FUNC_QUALIFIER tvec2 & tvec2::operator=(tvec2 const & v) diff --git a/glm/detail/type_vec3.hpp b/glm/detail/type_vec3.hpp index 920d8acb..a8abb062 100644 --- a/glm/detail/type_vec3.hpp +++ b/glm/detail/type_vec3.hpp @@ -105,7 +105,6 @@ namespace glm // Implicit basic constructors GLM_FUNC_DECL tvec3(); - GLM_FUNC_DECL tvec3(tvec3 const & v); template GLM_FUNC_DECL tvec3(tvec3 const & v); @@ -173,8 +172,6 @@ namespace glm ////////////////////////////////////// // Unary arithmetic operators - GLM_FUNC_DECL tvec3 & operator=(tvec3 const & v); - template GLM_FUNC_DECL tvec3 & operator=(tvec3 const & v); template diff --git a/glm/detail/type_vec3.inl b/glm/detail/type_vec3.inl index 6eb56791..75459d7b 100644 --- a/glm/detail/type_vec3.inl +++ b/glm/detail/type_vec3.inl @@ -69,11 +69,6 @@ namespace glm # endif {} - template - GLM_FUNC_QUALIFIER tvec3::tvec3(tvec3 const & v) - : x(v.x), y(v.y), z(v.z) - {} - template template GLM_FUNC_QUALIFIER tvec3::tvec3(tvec3 const & v) @@ -170,15 +165,6 @@ namespace glm ////////////////////////////////////// // Unary arithmetic operators - template - GLM_FUNC_QUALIFIER tvec3& tvec3::operator=(tvec3 const & v) - { - this->x = v.x; - this->y = v.y; - this->z = v.z; - return *this; - } - template template GLM_FUNC_QUALIFIER tvec3& tvec3::operator=(tvec3 const & v) diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index f92b6a38..9dc3e8a8 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -67,7 +67,7 @@ namespace detail }//namespace detail template - GLM_ALIGNED_STRUCT(16) tvec4 + struct tvec4 { ////////////////////////////////////// // Implementation detail @@ -148,7 +148,6 @@ namespace detail // Implicit basic constructors GLM_FUNC_DECL tvec4(); - GLM_FUNC_DECL tvec4(tvec4 const & v); template GLM_FUNC_DECL tvec4(tvec4 const & v); @@ -158,6 +157,7 @@ namespace detail GLM_FUNC_DECL explicit tvec4(ctor); GLM_FUNC_DECL explicit tvec4(T const & s); GLM_FUNC_DECL tvec4(T const & s0, T const & s1, T const & s2, T const & s3); + GLM_FUNC_DECL ~tvec4(){} ////////////////////////////////////// // Conversion scalar constructors @@ -258,8 +258,6 @@ namespace detail ////////////////////////////////////// // Unary arithmetic operators - GLM_FUNC_DECL tvec4 & operator=(tvec4 const & v); - template GLM_FUNC_DECL tvec4 & operator=(tvec4 const & v); template diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 04e9b8cf..97ada0b7 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -84,7 +84,7 @@ namespace glm # endif {} #endif - +/* template GLM_FUNC_QUALIFIER tvec4::tvec4(tvec4 const & v) : x(v.x), y(v.y), z(v.z), w(v.w) @@ -101,7 +101,7 @@ namespace glm : data(v.data) {} #endif - +*/ template template GLM_FUNC_QUALIFIER tvec4::tvec4(tvec4 const & v) @@ -283,7 +283,7 @@ namespace glm ////////////////////////////////////// // Unary arithmetic operators - +/* template GLM_FUNC_QUALIFIER tvec4 & tvec4::operator=(tvec4 const & v) { @@ -309,7 +309,7 @@ namespace glm return *this; } #endif - +*/ template template GLM_FUNC_QUALIFIER tvec4 & tvec4::operator=(tvec4 const & v) diff --git a/test/core/core_func_common.cpp b/test/core/core_func_common.cpp index ee75fbf8..61256f30 100644 --- a/test/core/core_func_common.cpp +++ b/test/core/core_func_common.cpp @@ -866,7 +866,7 @@ namespace sign { int Error = 0; - std::size_t const Count = 1000000000; + std::size_t const Count = 10000000; std::vector Input, Output; Input.resize(Count); Output.resize(Count); @@ -913,7 +913,7 @@ namespace sign { int Error = 0; - std::size_t const Count = 1000000000; + std::size_t const Count = 10000000; std::vector Input, Output; Input.resize(Count); Output.resize(Count); @@ -960,7 +960,7 @@ namespace sign { int Error = 0; - glm::uint32 const Count = 1000000000; + glm::uint32 const Count = 10000000; std::clock_t Timestamp0 = std::clock(); glm::int32 Sum = 0; diff --git a/test/core/core_func_integer.cpp b/test/core/core_func_integer.cpp index 5493c4bf..68a135d5 100644 --- a/test/core/core_func_integer.cpp +++ b/test/core/core_func_integer.cpp @@ -37,11 +37,12 @@ namespace bitfieldInsert typeU32 const Data32[] = { + {0x00000000, 0xffffffff, 0, 31, 0x7fffffff}, + {0x00000000, 0xffffffff, 0, 32, 0xffffffff}, + {0x00000000, 0xffffffff, 0, 0, 0x00000000}, {0xff000000, 0x0000ff00, 8, 8, 0xff00ff00}, {0xffff0000, 0x0000ffff, 16, 16, 0x00000000}, - {0x0000ffff, 0xffff0000, 16, 16, 0xffffffff}, - {0x00000000, 0xffffffff, 0, 32, 0xffffffff}, - {0x00000000, 0xffffffff, 0, 0, 0x00000000} + {0x0000ffff, 0xffff0000, 16, 16, 0xffffffff} }; int test() @@ -664,7 +665,7 @@ namespace findMSB std::clock_t Timestamps1 = std::clock(); - for(std::size_t k = 0; k < 10000000; ++k) + for(std::size_t k = 0; k < 1000000; ++k) for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) { int Result = findMSB_095(Data[i].Value); @@ -723,7 +724,7 @@ namespace findMSB std::clock_t Timestamps1 = std::clock(); - for(std::size_t k = 0; k < 10000000; ++k) + for(std::size_t k = 0; k < 1000000; ++k) for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) { int Result = findMSB_nlz1(Data[i].Value); diff --git a/test/core/core_type_mat4x4.cpp b/test/core/core_type_mat4x4.cpp index bda125c0..b77efae5 100644 --- a/test/core/core_type_mat4x4.cpp +++ b/test/core/core_type_mat4x4.cpp @@ -188,6 +188,14 @@ int test_ctr() { int Error(0); +#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12) + //Error += std::is_trivially_default_constructible::value ? 0 : 1; + //Error += std::is_trivially_copy_assignable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + //Error += std::is_copy_constructible::value ? 0 : 1; + //Error += std::has_trivial_copy_constructor::value ? 0 : 1; +#endif + #if(GLM_HAS_INITIALIZER_LISTS) glm::mat4 m0( glm::vec4(0, 1, 2, 3), diff --git a/test/core/core_type_vec1.cpp b/test/core/core_type_vec1.cpp index 6dfc33fc..d32d4be8 100644 --- a/test/core/core_type_vec1.cpp +++ b/test/core/core_type_vec1.cpp @@ -44,6 +44,18 @@ int test_vec1_ctor() { int Error = 0; +#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12) +// Error += std::is_trivially_default_constructible::value ? 0 : 1; +// Error += std::is_trivially_copy_assignable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + + Error += std::has_trivial_copy_constructor::value ? 0 : 1; + Error += std::is_copy_constructible::value ? 0 : 1; +#endif + /* #if GLM_HAS_INITIALIZER_LISTS { diff --git a/test/core/core_type_vec2.cpp b/test/core/core_type_vec2.cpp index 12a897e4..5a797cb8 100644 --- a/test/core/core_type_vec2.cpp +++ b/test/core/core_type_vec2.cpp @@ -201,6 +201,18 @@ int test_vec2_ctor() { int Error = 0; +#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12) +// Error += std::is_trivially_default_constructible::value ? 0 : 1; +// Error += std::is_trivially_copy_assignable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + + Error += std::has_trivial_copy_constructor::value ? 0 : 1; + Error += std::is_copy_constructible::value ? 0 : 1; +#endif + #if GLM_HAS_INITIALIZER_LISTS { glm::vec2 a{ 0, 1 }; diff --git a/test/core/core_type_vec3.cpp b/test/core/core_type_vec3.cpp index f1cc8b91..f2fe3ad2 100644 --- a/test/core/core_type_vec3.cpp +++ b/test/core/core_type_vec3.cpp @@ -19,8 +19,20 @@ int test_vec3_ctor() { int Error = 0; - -#if(GLM_HAS_INITIALIZER_LISTS) + +#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12) +// Error += std::is_trivially_default_constructible::value ? 0 : 1; +// Error += std::is_trivially_copy_assignable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + + Error += std::has_trivial_copy_constructor::value ? 0 : 1; + Error += std::is_copy_constructible::value ? 0 : 1; +#endif + +#if (GLM_HAS_INITIALIZER_LISTS) { glm::vec3 a{ 0, 1, 2 }; std::vector v = { diff --git a/test/core/core_type_vec4.cpp b/test/core/core_type_vec4.cpp index 0c5e92ff..e373dbad 100644 --- a/test/core/core_type_vec4.cpp +++ b/test/core/core_type_vec4.cpp @@ -42,7 +42,23 @@ enum comp int test_vec4_ctor() { int Error = 0; - + + glm::ivec4 A(1, 2, 3, 4); + glm::ivec4 B(A); + Error += glm::all(glm::equal(A, B)) ? 0 : 1; + +#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12) +// Error += std::is_trivially_default_constructible::value ? 0 : 1; +// Error += std::is_trivially_copy_assignable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + + Error += std::has_trivial_copy_constructor::value ? 0 : 1; + Error += std::is_copy_constructible::value ? 0 : 1; +#endif + #if GLM_HAS_INITIALIZER_LISTS { glm::vec4 a{ 0, 1, 2, 3 }; diff --git a/test/gtc/gtc_bitfield.cpp b/test/gtc/gtc_bitfield.cpp index eed75a44..2763e874 100644 --- a/test/gtc/gtc_bitfield.cpp +++ b/test/gtc/gtc_bitfield.cpp @@ -103,10 +103,12 @@ namespace mask { type const Data[] = { - {0, 0x00000000}, - {1, 0x00000001}, - {2, 0x00000003}, - {3, 0x00000007} + { 0, 0x00000000}, + { 1, 0x00000001}, + { 2, 0x00000003}, + { 3, 0x00000007}, + {31, 0x7fffffff}, + {32, 0xffffffff} }; int Error(0); @@ -142,10 +144,12 @@ namespace mask { type const Data[] = { - {glm::ivec4(0), glm::ivec4(0x00000000)}, - {glm::ivec4(1), glm::ivec4(0x00000001)}, - {glm::ivec4(2), glm::ivec4(0x00000003)}, - {glm::ivec4(3), glm::ivec4(0x00000007)} + {glm::ivec4( 0), glm::ivec4(0x00000000)}, + {glm::ivec4( 1), glm::ivec4(0x00000001)}, + {glm::ivec4( 2), glm::ivec4(0x00000003)}, + {glm::ivec4( 3), glm::ivec4(0x00000007)}, + {glm::ivec4(31), glm::ivec4(0x7fffffff)}, + {glm::ivec4(32), glm::ivec4(0xffffffff)} }; int Error(0);