Browse Source

Added GLM_FORCE_EXPLICIT_CTOR

Christophe Riccio 11 years ago
parent
commit
9c62eee507
4 changed files with 40 additions and 12 deletions
  1. 10 3
      glm/detail/type_vec1.hpp
  2. 10 3
      glm/detail/type_vec2.hpp
  3. 10 3
      glm/detail/type_vec3.hpp
  4. 10 3
      glm/detail/type_vec4.hpp

+ 10 - 3
glm/detail/type_vec1.hpp

@@ -114,9 +114,6 @@ namespace glm
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Conversion vector constructors
 		// Conversion vector constructors
 		
 		
-		//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
-		template <typename U, precision Q>
-		GLM_FUNC_DECL explicit tvec1(tvec1<U, Q> const & v);
 		//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
 		//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
 		template <typename U, precision Q>
 		template <typename U, precision Q>
 		GLM_FUNC_DECL explicit tvec1(tvec2<U, Q> const & v);
 		GLM_FUNC_DECL explicit tvec1(tvec2<U, Q> const & v);
@@ -127,6 +124,16 @@ namespace glm
 		template <typename U, precision Q>
 		template <typename U, precision Q>
 		GLM_FUNC_DECL explicit tvec1(tvec4<U, Q> const & v);
 		GLM_FUNC_DECL explicit tvec1(tvec4<U, Q> const & v);
 
 
+#		ifdef GLM_FORCE_EXPLICIT_CTOR
+			//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
+			template <typename U, precision Q>
+			GLM_FUNC_DECL explicit tvec1(tvec1<U, Q> const & v);
+#		else
+			//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
+			template <typename U, precision Q>
+			GLM_FUNC_DECL tvec1(tvec1<U, Q> const & v);
+#		endif
+
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Swizzle constructors
 		// Swizzle constructors
 
 

+ 10 - 3
glm/detail/type_vec2.hpp

@@ -126,9 +126,6 @@ namespace glm
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Conversion vector constructors
 		// Conversion vector constructors
 
 
-		//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
-		template <typename U, precision Q>
-		GLM_FUNC_DECL explicit tvec2(tvec2<U, Q> const & v);
 		//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
 		//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
 		template <typename U, precision Q>
 		template <typename U, precision Q>
 		GLM_FUNC_DECL explicit tvec2(tvec3<U, Q> const & v);
 		GLM_FUNC_DECL explicit tvec2(tvec3<U, Q> const & v);
@@ -136,6 +133,16 @@ namespace glm
 		template <typename U, precision Q>
 		template <typename U, precision Q>
 		GLM_FUNC_DECL explicit tvec2(tvec4<U, Q> const & v);
 		GLM_FUNC_DECL explicit tvec2(tvec4<U, Q> const & v);
 
 
+#		ifdef GLM_FORCE_EXPLICIT_CTOR
+			//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
+			template <typename U, precision Q>
+			GLM_FUNC_DECL explicit tvec2(tvec2<U, Q> const & v);
+#		else
+			//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
+			template <typename U, precision Q>
+			GLM_FUNC_DECL tvec2(tvec2<U, Q> const & v);
+#		endif
+
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Swizzle constructors
 		// Swizzle constructors
 
 

+ 10 - 3
glm/detail/type_vec3.hpp

@@ -141,11 +141,18 @@ namespace glm
 		GLM_FUNC_DECL explicit tvec3(tvec1<A, Q> const & a, tvec2<B, Q> const & b);
 		GLM_FUNC_DECL explicit tvec3(tvec1<A, Q> const & a, tvec2<B, Q> const & b);
 		//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
 		//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
 		template <typename U, precision Q>
 		template <typename U, precision Q>
-		GLM_FUNC_DECL explicit tvec3(tvec3<U, Q> const & v);
-		//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
-		template <typename U, precision Q>
 		GLM_FUNC_DECL explicit tvec3(tvec4<U, Q> const & v);
 		GLM_FUNC_DECL explicit tvec3(tvec4<U, Q> const & v);
 
 
+#		ifdef GLM_FORCE_EXPLICIT_CTOR
+			//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
+			template <typename U, precision Q>
+			GLM_FUNC_DECL explicit tvec3(tvec3<U, Q> const & v);
+#		else
+			//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
+			template <typename U, precision Q>
+			GLM_FUNC_DECL tvec3(tvec3<U, Q> const & v);
+#		endif
+
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Swizzle constructors
 		// Swizzle constructors
 
 

+ 10 - 3
glm/detail/type_vec4.hpp

@@ -188,9 +188,16 @@ namespace detail
 		//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
 		//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
 		template <typename A, typename B, precision Q>
 		template <typename A, typename B, precision Q>
 		GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & a, tvec2<B, Q> const & b);
 		GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & a, tvec2<B, Q> const & b);
-		//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
-		template <typename U, precision Q>
-		GLM_FUNC_DECL explicit tvec4(tvec4<U, Q> const & v);
+		
+#		ifdef GLM_FORCE_EXPLICIT_CTOR
+			//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
+			template <typename U, precision Q>
+			GLM_FUNC_DECL explicit tvec4(tvec4<U, Q> const & v);
+#		else
+			//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
+			template <typename U, precision Q>
+			GLM_FUNC_DECL tvec4(tvec4<U, Q> const & v);
+#		endif
 
 
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Swizzle constructors
 		// Swizzle constructors