Browse Source

Initial std trivial experiments #263

Christophe Riccio 11 years ago
parent
commit
931e72b456

+ 4 - 0
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

+ 2 - 2
glm/detail/type_vec4.hpp

@@ -148,7 +148,7 @@ namespace detail
 		// Implicit basic constructors
 
 		GLM_FUNC_DECL tvec4();
-		GLM_FUNC_DECL tvec4(tvec4<T, P> const & v);
+		//GLM_FUNC_DECL tvec4(tvec4<T, P> const & v);
 		template <precision Q>
 		GLM_FUNC_DECL tvec4(tvec4<T, Q> const & v);
 
@@ -258,7 +258,7 @@ namespace detail
 		//////////////////////////////////////
 		// Unary arithmetic operators
 
-		GLM_FUNC_DECL tvec4<T, P> & operator=(tvec4<T, P> const & v);
+		//GLM_FUNC_DECL tvec4<T, P> & operator=(tvec4<T, P> const & v);
 
 		template <typename U>
 		GLM_FUNC_DECL tvec4<T, P> & operator=(tvec4<U, P> const & v);

+ 4 - 4
glm/detail/type_vec4.inl

@@ -84,7 +84,7 @@ namespace glm
 #		endif
 	{}
 #endif
-	
+/*
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec4<T, P> 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 <typename T, precision P>
 	template <precision Q>
 	GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec4<T, Q> const & v)
@@ -283,7 +283,7 @@ namespace glm
 
 	//////////////////////////////////////
 	// Unary arithmetic operators
-
+/*
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator=(tvec4<T, P> const & v)
 	{
@@ -309,7 +309,7 @@ namespace glm
 		return *this;
 	}
 #endif
-
+*/
 	template <typename T, precision P>
 	template <typename U>
 	GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator=(tvec4<U, P> const & v)

+ 2 - 0
test/core/core_type_mat4x4.cpp

@@ -188,6 +188,8 @@ int test_ctr()
 {
 	int Error(0);
 
+	Error += std::is_copy_constructible<glm::mat4>::value ? 0 : 1;
+
 #if(GLM_HAS_INITIALIZER_LISTS)
 	glm::mat4 m0(
 		glm::vec4(0, 1, 2, 3), 

+ 13 - 1
test/core/core_type_vec4.cpp

@@ -42,7 +42,19 @@ 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;
+
+	Error += std::is_trivially_copy_assignable<glm::vec4>::value ? 0 : 1;
+	Error += std::is_trivially_copyable<glm::vec4>::value ? 0 : 1;
+	Error += std::is_trivially_copy_assignable<glm::vec3>::value ? 0 : 1;
+	Error += std::is_trivially_copyable<glm::vec3>::value ? 0 : 1;
+
+	Error += std::has_trivial_copy_constructor<glm::vec4>::value ? 0 : 1;
+	Error += std::is_copy_constructible<glm::vec4>::value ? 0 : 1;
+
 #if GLM_HAS_INITIALIZER_LISTS
 	{
 		glm::vec4 a{ 0, 1, 2, 3 };