From 9c62eee507b218426d7ca1facf7dbe54f475116d Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 17 Nov 2014 21:40:17 +0100 Subject: [PATCH] Added GLM_FORCE_EXPLICIT_CTOR --- glm/detail/type_vec1.hpp | 13 ++++++++++--- glm/detail/type_vec2.hpp | 13 ++++++++++--- glm/detail/type_vec3.hpp | 13 ++++++++++--- glm/detail/type_vec4.hpp | 13 ++++++++++--- 4 files changed, 40 insertions(+), 12 deletions(-) diff --git a/glm/detail/type_vec1.hpp b/glm/detail/type_vec1.hpp index ba6372d3..bd7aed19 100644 --- a/glm/detail/type_vec1.hpp +++ b/glm/detail/type_vec1.hpp @@ -114,9 +114,6 @@ namespace glm ////////////////////////////////////// // Conversion vector constructors - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec1(tvec1 const & v); //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec1(tvec2 const & v); @@ -127,6 +124,16 @@ namespace glm template GLM_FUNC_DECL explicit tvec1(tvec4 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 + GLM_FUNC_DECL explicit tvec1(tvec1 const & v); +# else + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL tvec1(tvec1 const & v); +# endif + ////////////////////////////////////// // Swizzle constructors diff --git a/glm/detail/type_vec2.hpp b/glm/detail/type_vec2.hpp index e3d77690..a0446246 100644 --- a/glm/detail/type_vec2.hpp +++ b/glm/detail/type_vec2.hpp @@ -126,9 +126,6 @@ namespace glm ////////////////////////////////////// // Conversion vector constructors - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec2(tvec2 const & v); //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec2(tvec3 const & v); @@ -136,6 +133,16 @@ namespace glm template GLM_FUNC_DECL explicit tvec2(tvec4 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 + GLM_FUNC_DECL explicit tvec2(tvec2 const & v); +# else + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL tvec2(tvec2 const & v); +# endif + ////////////////////////////////////// // Swizzle constructors diff --git a/glm/detail/type_vec3.hpp b/glm/detail/type_vec3.hpp index a8abb062..fba9d015 100644 --- a/glm/detail/type_vec3.hpp +++ b/glm/detail/type_vec3.hpp @@ -141,11 +141,18 @@ namespace glm GLM_FUNC_DECL explicit tvec3(tvec1 const & a, tvec2 const & b); //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL explicit tvec3(tvec3 const & v); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template GLM_FUNC_DECL explicit tvec3(tvec4 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 + GLM_FUNC_DECL explicit tvec3(tvec3 const & v); +# else + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL tvec3(tvec3 const & v); +# endif + ////////////////////////////////////// // Swizzle constructors diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index 05689ece..75ced992 100644 --- a/glm/detail/type_vec4.hpp +++ b/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) template GLM_FUNC_DECL explicit tvec4(tvec2 const & a, tvec2 const & b); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec4(tvec4 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 + GLM_FUNC_DECL explicit tvec4(tvec4 const & v); +# else + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL tvec4(tvec4 const & v); +# endif ////////////////////////////////////// // Swizzle constructors