Browse Source

Added GLM_FORCE_CTOR_INIT #735 #740

Christophe Riccio 7 years ago
parent
commit
8390a77b3a

+ 11 - 0
glm/detail/setup.hpp

@@ -720,8 +720,19 @@
 
 
 #if GLM_HAS_DEFAULTED_FUNCTIONS
 #if GLM_HAS_DEFAULTED_FUNCTIONS
 #	define GLM_DEFAULT = default
 #	define GLM_DEFAULT = default
+
+#	ifdef GLM_FORCE_NO_CTOR_INIT
+#		undef GLM_FORCE_CTOR_INIT
+#	endif
+
+#	ifdef GLM_FORCE_CTOR_INIT
+#		define GLM_DEFAULT_CTOR
+#	else
+#		define GLM_DEFAULT_CTOR = default
+#	endif
 #else
 #else
 #	define GLM_DEFAULT
 #	define GLM_DEFAULT
+#	define GLM_DEFAULT_CTOR
 #endif
 #endif
 
 
 #if GLM_HAS_CONSTEXPR || GLM_HAS_CONSTEXPR_PARTIAL
 #if GLM_HAS_CONSTEXPR || GLM_HAS_CONSTEXPR_PARTIAL

+ 1 - 1
glm/detail/type_mat2x2.hpp

@@ -34,7 +34,7 @@ namespace glm
 
 
 		// -- Constructors --
 		// -- Constructors --
 
 
-		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT;
+		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, Q> const& m) GLM_DEFAULT;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, Q> const& m) GLM_DEFAULT;
 		template<qualifier P>
 		template<qualifier P>
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, P> const& m);
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, P> const& m);

+ 7 - 2
glm/detail/type_mat2x2.inl

@@ -7,10 +7,15 @@ namespace glm
 {
 {
 	// -- Constructors --
 	// -- Constructors --
 
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS
+#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
 		template<typename T, qualifier Q>
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat()
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat()
-		{}
+		{
+#			ifdef GLM_FORCE_CTOR_INIT
+				this->value[0] = col_type(1, 0);
+				this->value[1] = col_type(0, 1);
+#			endif
+		}
 #	endif
 #	endif
 
 
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS

+ 1 - 1
glm/detail/type_mat2x3.hpp

@@ -35,7 +35,7 @@ namespace glm
 
 
 		// -- Constructors --
 		// -- Constructors --
 
 
-		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT;
+		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, Q> const& m) GLM_DEFAULT;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, Q> const& m) GLM_DEFAULT;
 		template<qualifier P>
 		template<qualifier P>
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, P> const& m);
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, P> const& m);

+ 7 - 2
glm/detail/type_mat2x3.inl

@@ -5,10 +5,15 @@ namespace glm
 {
 {
 	// -- Constructors --
 	// -- Constructors --
 
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS
+#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
 		template<typename T, qualifier Q>
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat()
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat()
-		{}
+		{
+#			ifdef GLM_FORCE_CTOR_INIT
+				this->value[0] = col_type(1, 0, 0);
+				this->value[1] = col_type(0, 1, 0);
+#			endif
+		}
 #	endif
 #	endif
 
 
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS

+ 1 - 1
glm/detail/type_mat2x4.hpp

@@ -35,7 +35,7 @@ namespace glm
 
 
 		// -- Constructors --
 		// -- Constructors --
 
 
-		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT;
+		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, Q> const& m) GLM_DEFAULT;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, Q> const& m) GLM_DEFAULT;
 		template<qualifier P>
 		template<qualifier P>
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, P> const& m);
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, P> const& m);

+ 7 - 2
glm/detail/type_mat2x4.inl

@@ -5,10 +5,15 @@ namespace glm
 {
 {
 	// -- Constructors --
 	// -- Constructors --
 
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS
+#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
 		template<typename T, qualifier Q>
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat()
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat()
-		{}
+		{
+#			ifdef GLM_FORCE_CTOR_INIT
+				this->value[0] = col_type(1, 0, 0, 0);
+				this->value[1] = col_type(0, 1, 0, 0);
+#			endif
+		}
 #	endif
 #	endif
 
 
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS

+ 1 - 1
glm/detail/type_mat3x2.hpp

@@ -35,7 +35,7 @@ namespace glm
 
 
 		// -- Constructors --
 		// -- Constructors --
 
 
-		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT;
+		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, Q> const& m) GLM_DEFAULT;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, Q> const& m) GLM_DEFAULT;
 		template<qualifier P>
 		template<qualifier P>
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, P> const& m);
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, P> const& m);

+ 8 - 2
glm/detail/type_mat3x2.inl

@@ -5,10 +5,16 @@ namespace glm
 {
 {
 	// -- Constructors --
 	// -- Constructors --
 
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS
+#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
 		template<typename T, qualifier Q>
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat()
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat()
-		{}
+		{
+#			ifdef GLM_FORCE_CTOR_INIT
+				this->value[0] = col_type(1, 0);
+				this->value[1] = col_type(0, 1);
+				this->value[2] = col_type(0, 0);
+#			endif
+		}
 #	endif
 #	endif
 
 
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS

+ 1 - 1
glm/detail/type_mat3x3.hpp

@@ -34,7 +34,7 @@ namespace glm
 
 
 		// -- Constructors --
 		// -- Constructors --
 
 
-		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT;
+		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, Q> const& m) GLM_DEFAULT;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, Q> const& m) GLM_DEFAULT;
 		template<qualifier P>
 		template<qualifier P>
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, P> const& m);
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, P> const& m);

+ 8 - 2
glm/detail/type_mat3x3.inl

@@ -7,10 +7,16 @@ namespace glm
 {
 {
 	// -- Constructors --
 	// -- Constructors --
 
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS
+#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
 		template<typename T, qualifier Q>
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat()
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat()
-		{}
+		{
+#			ifdef GLM_FORCE_CTOR_INIT
+				this->value[0] = col_type(1, 0, 0);
+				this->value[1] = col_type(0, 1, 0);
+				this->value[2] = col_type(0, 0, 1);
+#			endif
+		}
 #	endif
 #	endif
 
 
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS

+ 1 - 1
glm/detail/type_mat3x4.hpp

@@ -35,7 +35,7 @@ namespace glm
 
 
 		// -- Constructors --
 		// -- Constructors --
 
 
-		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT;
+		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, Q> const& m) GLM_DEFAULT;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, Q> const& m) GLM_DEFAULT;
 		template<qualifier P>
 		template<qualifier P>
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, P> const& m);
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, P> const& m);

+ 8 - 2
glm/detail/type_mat3x4.inl

@@ -5,10 +5,16 @@ namespace glm
 {
 {
 	// -- Constructors --
 	// -- Constructors --
 
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS
+#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
 		template<typename T, qualifier Q>
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat()
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat()
-		{}
+		{
+#			ifdef GLM_FORCE_CTOR_INIT
+				this->value[0] = col_type(1, 0, 0, 0);
+				this->value[1] = col_type(0, 1, 0, 0);
+				this->value[2] = col_type(0, 0, 1, 0);
+#			endif
+		}
 #	endif
 #	endif
 
 
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS

+ 1 - 1
glm/detail/type_mat4x2.hpp

@@ -35,7 +35,7 @@ namespace glm
 
 
 		// -- Constructors --
 		// -- Constructors --
 
 
-		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT;
+		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, Q> const& m) GLM_DEFAULT;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, Q> const& m) GLM_DEFAULT;
 		template<qualifier P>
 		template<qualifier P>
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, P> const& m);
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, P> const& m);

+ 9 - 2
glm/detail/type_mat4x2.inl

@@ -5,10 +5,17 @@ namespace glm
 {
 {
 	// -- Constructors --
 	// -- Constructors --
 
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS
+#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
 		template<typename T, qualifier Q>
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat()
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat()
-		{}
+		{
+#			ifdef GLM_FORCE_CTOR_INIT
+				this->value[0] = col_type(1, 0);
+				this->value[1] = col_type(0, 1);
+				this->value[2] = col_type(0, 0);
+				this->value[3] = col_type(0, 0);
+#			endif
+		}
 #	endif
 #	endif
 
 
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS

+ 1 - 1
glm/detail/type_mat4x3.hpp

@@ -35,7 +35,7 @@ namespace glm
 
 
 		// -- Constructors --
 		// -- Constructors --
 
 
-		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT;
+		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, Q> const& m) GLM_DEFAULT;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, Q> const& m) GLM_DEFAULT;
 		template<qualifier P>
 		template<qualifier P>
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, P> const& m);
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, P> const& m);

+ 9 - 2
glm/detail/type_mat4x3.inl

@@ -5,10 +5,17 @@ namespace glm
 {
 {
 	// -- Constructors --
 	// -- Constructors --
 
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS
+#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
 		template<typename T, qualifier Q>
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat()
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat()
-		{}
+		{
+#			ifdef GLM_FORCE_CTOR_INIT
+				this->value[0] = col_type(1, 0, 0);
+				this->value[1] = col_type(0, 1, 0);
+				this->value[2] = col_type(0, 0, 1);
+				this->value[3] = col_type(0, 0, 0);
+#			endif
+		}
 #	endif
 #	endif
 
 
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS

+ 1 - 1
glm/detail/type_mat4x4.hpp

@@ -34,7 +34,7 @@ namespace glm
 
 
 		// -- Constructors --
 		// -- Constructors --
 
 
-		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT;
+		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, Q> const& m) GLM_DEFAULT;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, Q> const& m) GLM_DEFAULT;
 		template<qualifier P>
 		template<qualifier P>
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, P> const& m);
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, P> const& m);

+ 9 - 2
glm/detail/type_mat4x4.inl

@@ -7,10 +7,17 @@ namespace glm
 {
 {
 	// -- Constructors --
 	// -- Constructors --
 
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS
+#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
 		template<typename T, qualifier Q>
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat()
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat()
-		{}
+		{
+#			ifdef GLM_FORCE_CTOR_INIT
+				this->value[0] = col_type(1, 0, 0, 0);
+				this->value[1] = col_type(0, 1, 0, 0);
+				this->value[2] = col_type(0, 0, 1, 0);
+				this->value[3] = col_type(0, 0, 0, 1);
+#			endif
+		}
 #	endif
 #	endif
 
 
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS

+ 5 - 2
glm/detail/type_vec1.inl

@@ -5,11 +5,14 @@ namespace glm
 {
 {
 	// -- Implicit basic constructors --
 	// -- Implicit basic constructors --
 
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS
+#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
 		template<typename T, qualifier Q>
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec()
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec()
+#			ifdef GLM_FORCE_CTOR_INIT
+				: x(0)
+#			endif
 		{}
 		{}
-#	endif//!GLM_HAS_DEFAULTED_FUNCTIONS
+#	endif//!GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
 
 
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS
 		template<typename T, qualifier Q>
 		template<typename T, qualifier Q>

+ 1 - 1
glm/detail/type_vec2.hpp

@@ -86,7 +86,7 @@ namespace glm
 
 
 		// -- Implicit basic constructors --
 		// -- Implicit basic constructors --
 
 
-		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec() GLM_DEFAULT;
+		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec const& v) GLM_DEFAULT;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec const& v) GLM_DEFAULT;
 		template<qualifier P>
 		template<qualifier P>
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<2, T, P> const& v);
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<2, T, P> const& v);

+ 5 - 2
glm/detail/type_vec2.inl

@@ -5,11 +5,14 @@ namespace glm
 {
 {
 	// -- Implicit basic constructors --
 	// -- Implicit basic constructors --
 
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS
+#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
 		template<typename T, qualifier Q>
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, Q>::vec()
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, Q>::vec()
+#			ifdef GLM_FORCE_CTOR_INIT
+				: x(0), y(0)
+#			endif
 		{}
 		{}
-#	endif//!GLM_HAS_DEFAULTED_FUNCTIONS
+#	endif//!GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
 
 
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS
 		template<typename T, qualifier Q>
 		template<typename T, qualifier Q>

+ 1 - 1
glm/detail/type_vec3.hpp

@@ -86,7 +86,7 @@ namespace glm
 
 
 		// -- Implicit basic constructors --
 		// -- Implicit basic constructors --
 
 
-		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec() GLM_DEFAULT;
+		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec const& v) GLM_DEFAULT;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec const& v) GLM_DEFAULT;
 		template<qualifier P>
 		template<qualifier P>
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<3, T, P> const& v);
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<3, T, P> const& v);

+ 5 - 2
glm/detail/type_vec3.inl

@@ -5,11 +5,14 @@ namespace glm
 {
 {
 	// -- Implicit basic constructors --
 	// -- Implicit basic constructors --
 
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS
+#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
 		template<typename T, qualifier Q>
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec()
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec()
+#			ifdef GLM_FORCE_CTOR_INIT
+				: x(0), y(0), z(0)
+#			endif
 		{}
 		{}
-#	endif//!GLM_HAS_DEFAULTED_FUNCTIONS
+#	endif//!GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
 
 
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS
 		template<typename T, qualifier Q>
 		template<typename T, qualifier Q>

+ 1 - 1
glm/detail/type_vec4.hpp

@@ -89,7 +89,7 @@ namespace glm
 
 
 		// -- Implicit basic constructors --
 		// -- Implicit basic constructors --
 
 
-		GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec() GLM_DEFAULT;
+		GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(vec<4, T, Q> const& v) GLM_DEFAULT;
 		GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(vec<4, T, Q> const& v) GLM_DEFAULT;
 		template<qualifier P>
 		template<qualifier P>
 		GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(vec<4, T, P> const& v);
 		GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(vec<4, T, P> const& v);

+ 5 - 2
glm/detail/type_vec4.inl

@@ -158,11 +158,14 @@ namespace detail
 
 
 	// -- Implicit basic constructors --
 	// -- Implicit basic constructors --
 
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS
+#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
 		template<typename T, qualifier Q>
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, Q>::vec()
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, Q>::vec()
+#			ifdef GLM_FORCE_CTOR_INIT
+				: x(0), y(0), z(0), w(0)
+#			endif
 		{}
 		{}
-#	endif//!GLM_HAS_DEFAULTED_FUNCTIONS
+#	endif//!GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
 
 
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS
 		template<typename T, qualifier Q>
 		template<typename T, qualifier Q>

+ 1 - 1
glm/ext/vec1.hpp

@@ -101,7 +101,7 @@ namespace glm
 
 
 		// -- Implicit basic constructors --
 		// -- Implicit basic constructors --
 
 
-		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec() GLM_DEFAULT;
+		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec const& v) GLM_DEFAULT;
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec const& v) GLM_DEFAULT;
 		template<qualifier P>
 		template<qualifier P>
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, T, P> const& v);
 		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, T, P> const& v);

+ 1 - 1
glm/gtc/quaternion.hpp

@@ -77,7 +77,7 @@ namespace glm
 
 
 		// -- Implicit basic constructors --
 		// -- Implicit basic constructors --
 
 
-		GLM_FUNC_DECL GLM_CONSTEXPR tquat() GLM_DEFAULT;
+		GLM_FUNC_DECL GLM_CONSTEXPR tquat() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL GLM_CONSTEXPR tquat(tquat<T, Q> const& q) GLM_DEFAULT;
 		GLM_FUNC_DECL GLM_CONSTEXPR tquat(tquat<T, Q> const& q) GLM_DEFAULT;
 		template<qualifier P>
 		template<qualifier P>
 		GLM_FUNC_DECL GLM_CONSTEXPR tquat(tquat<T, P> const& q);
 		GLM_FUNC_DECL GLM_CONSTEXPR tquat(tquat<T, P> const& q);

+ 4 - 1
glm/gtc/quaternion.inl

@@ -85,9 +85,12 @@ namespace detail
 
 
 	// -- Implicit basic constructors --
 	// -- Implicit basic constructors --
 
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS
+#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
 		template<typename T, qualifier Q>
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, Q>::tquat()
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, Q>::tquat()
+#			ifdef GLM_FORCE_CTOR_INIT
+			: x(0), y(0), z(0), w(1)
+#			endif
 		{}
 		{}
 #	endif
 #	endif
 
 

+ 1 - 1
glm/gtx/dual_quaternion.hpp

@@ -56,7 +56,7 @@ namespace glm
 
 
 		// -- Implicit basic constructors --
 		// -- Implicit basic constructors --
 
 
-		GLM_FUNC_DECL GLM_CONSTEXPR tdualquat() GLM_DEFAULT;
+		GLM_FUNC_DECL GLM_CONSTEXPR tdualquat() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat<T, Q> const& d) GLM_DEFAULT;
 		GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat<T, Q> const& d) GLM_DEFAULT;
 		template<qualifier P>
 		template<qualifier P>
 		GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat<T, P> const& d);
 		GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat<T, P> const& d);

+ 5 - 1
glm/gtx/dual_quaternion.inl

@@ -24,9 +24,13 @@ namespace glm
 
 
 	// -- Implicit basic constructors --
 	// -- Implicit basic constructors --
 
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS
+#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
 		template<typename T, qualifier Q>
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat<T, Q>::tdualquat()
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat<T, Q>::tdualquat()
+#			ifdef GLM_FORCE_CTOR_INIT
+			: real(tquat<T, P>())
+			, dual(tquat<T, P>(0, 0, 0, 0))
+#			endif
 		{}
 		{}
 #	endif
 #	endif