瀏覽代碼

fix: no implicit vector copy

tszirr 12 年之前
父節點
當前提交
2d88860244

+ 4 - 0
glm/core/type_vec1.hpp

@@ -78,7 +78,9 @@ namespace detail
 		// Implicit basic constructors
 
 		GLM_FUNC_DECL tvec1();
+#ifndef GLM_NO_EXPLICIT_COPY
 		GLM_FUNC_DECL tvec1(tvec1<T> const & v);
+#endif
 
 		//////////////////////////////////////
 		// Explicit basic constructors
@@ -116,7 +118,9 @@ namespace detail
 		//////////////////////////////////////
 		// Unary arithmetic operators
 
+#ifndef GLM_NO_EXPLICIT_COPY
 		GLM_FUNC_DECL tvec1<T> & operator= (tvec1<T> const & v);
+#endif
 		template <typename U> 
 		GLM_FUNC_DECL tvec1<T> & operator= (tvec1<U> const & v);
 

+ 4 - 0
glm/core/type_vec1.inl

@@ -73,6 +73,7 @@ namespace detail
 	)
 	{}
 
+#ifndef GLM_NO_EXPLICIT_COPY
 	template <typename T>
 	GLM_FUNC_QUALIFIER tvec1<T>::tvec1
 	(
@@ -80,6 +81,7 @@ namespace detail
 	) :
 		x(v.x)
 	{}
+#endif
 
 	//////////////////////////////////////
 	// Explicit basic constructors
@@ -148,6 +150,7 @@ namespace detail
 	//////////////////////////////////////
 	// Unary arithmetic operators
 
+#ifndef GLM_NO_EXPLICIT_COPY
 	template <typename T>
 	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator=
 	(
@@ -157,6 +160,7 @@ namespace detail
 		this->x = v.x;
 		return *this;
 	}
+#endif
 
 	template <typename T>
 	template <typename U> 

+ 4 - 0
glm/core/type_vec2.hpp

@@ -107,7 +107,9 @@ namespace detail
 		// Implicit basic constructors
 
 		GLM_FUNC_DECL tvec2();
+#ifndef GLM_NO_EXPLICIT_COPY
 		GLM_FUNC_DECL tvec2(tvec2<T> const & v);
+#endif
 
 		//////////////////////////////////////
 		// Explicit basic constructors
@@ -160,7 +162,9 @@ namespace detail
 		//////////////////////////////////////
 		// Unary arithmetic operators
 
+#ifndef GLM_NO_EXPLICIT_COPY
 		GLM_FUNC_DECL tvec2<T> & operator= (tvec2<T> const & v);
+#endif
 		template <typename U> 
 		GLM_FUNC_DECL tvec2<T> & operator= (tvec2<U> const & v);
 

+ 4 - 0
glm/core/type_vec2.inl

@@ -76,6 +76,7 @@ namespace detail
 	)
 	{}
 
+#ifndef GLM_NO_EXPLICIT_COPY
 	template <typename T>
 	GLM_FUNC_QUALIFIER tvec2<T>::tvec2
 	(
@@ -84,6 +85,7 @@ namespace detail
 		x(v.x),
 		y(v.y)
 	{}
+#endif
 
 	//////////////////////////////////////
 	// Explicit basic constructors
@@ -179,6 +181,7 @@ namespace detail
 	//////////////////////////////////////
 	// Unary arithmetic operators
 
+#ifndef GLM_NO_EXPLICIT_COPY
 	template <typename T>
 	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator= 
 	(
@@ -189,6 +192,7 @@ namespace detail
 		this->y = v.y;
 		return *this;
 	}
+#endif
 
 	template <typename T>
 	template <typename U> 

+ 4 - 0
glm/core/type_vec3.hpp

@@ -108,7 +108,9 @@ namespace detail
 		// Implicit basic constructors
 
 		GLM_FUNC_DECL tvec3();
+#ifndef GLM_NO_EXPLICIT_COPY
 		GLM_FUNC_DECL tvec3(tvec3<T> const & v);
+#endif
 
 		//////////////////////////////////////
 		// Explicit basic constructors
@@ -184,7 +186,9 @@ namespace detail
 		//////////////////////////////////////
 		// Unary arithmetic operators
 
+#ifndef GLM_NO_EXPLICIT_COPY
 		GLM_FUNC_DECL tvec3<T> & operator= (tvec3<T> const & v);
+#endif
 		template <typename U> 
 		GLM_FUNC_DECL tvec3<T> & operator= (tvec3<U> const & v);
 

+ 4 - 0
glm/core/type_vec3.inl

@@ -77,6 +77,7 @@ namespace detail
 	)
 	{}
 
+#ifndef GLM_NO_EXPLICIT_COPY
 	template <typename T>
 	GLM_FUNC_QUALIFIER tvec3<T>::tvec3
 	(
@@ -86,6 +87,7 @@ namespace detail
 		y(v.y),
 		z(v.z)
 	{}
+#endif
 
 	//////////////////////////////////////
 	// Explicit basic constructors
@@ -228,6 +230,7 @@ namespace detail
 	//////////////////////////////////////
 	// Unary arithmetic operators
 
+#ifndef GLM_NO_EXPLICIT_COPY
 	template <typename T>
 	GLM_FUNC_QUALIFIER tvec3<T>& tvec3<T>::operator= 
 	(
@@ -239,6 +242,7 @@ namespace detail
 		this->z = v.z;
 		return *this;
 	}
+#endif
 
 	template <typename T>
 	template <typename U> 

+ 4 - 0
glm/core/type_vec4.hpp

@@ -109,7 +109,9 @@ namespace detail
 		// Implicit basic constructors
 
 		GLM_FUNC_DECL tvec4();
+#ifndef GLM_NO_EXPLICIT_COPY
 		GLM_FUNC_DECL tvec4(type const & v);
+#endif
 
 		//////////////////////////////////////
 		// Explicit basic constructors
@@ -239,7 +241,9 @@ namespace detail
 		//////////////////////////////////////
 		// Unary arithmetic operators
 
+#ifndef GLM_NO_EXPLICIT_COPY
 		GLM_FUNC_DECL tvec4<T> & operator= (tvec4<T> const & v);
+#endif
 		template <typename U>
 		GLM_FUNC_DECL tvec4<T> & operator= (tvec4<U> const & v);
 

+ 4 - 0
glm/core/type_vec4.inl

@@ -78,6 +78,7 @@ namespace detail
 	)
 	{}
 
+#ifndef GLM_NO_EXPLICIT_COPY
 	template <typename T>
 	GLM_FUNC_QUALIFIER tvec4<T>::tvec4
 	(
@@ -88,6 +89,7 @@ namespace detail
 		z(v.z),
 		w(v.w)
 	{}
+#endif
 
 	//////////////////////////////////////
 	// Explicit basic constructors
@@ -367,6 +369,7 @@ namespace detail
 	//////////////////////////////////////
 	// Unary arithmetic operators
 
+#ifndef GLM_NO_EXPLICIT_COPY
 	template <typename T>
 	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator= 
 	(
@@ -379,6 +382,7 @@ namespace detail
 		this->w = v.w;
 		return *this;
 	}
+#endif
 
 	template <typename T>
 	template <typename U>