Browse Source

Make (non-explicit) default constructor for Vector types

(cherry picked from commit 4d1aae0e99d07bcb2e81ee3ddf6ab0ddcb623426)
Michael Ragazzon 3 years ago
parent
commit
621a989bef

+ 3 - 1
Include/RmlUi/Core/Vector2.h

@@ -43,9 +43,11 @@ template < typename Type >
 class Vector2
 class Vector2
 {
 {
 	public:
 	public:
+		/// Default constructor.
+		inline Vector2();
 		/// Initialising constructor.
 		/// Initialising constructor.
 		/// @param[in] v Initial value of each element in the vector.
 		/// @param[in] v Initial value of each element in the vector.
-		explicit inline Vector2(Type v = Type{ 0 });
+		explicit inline Vector2(Type v);
 		/// Initialising constructor.
 		/// Initialising constructor.
 		/// @param[in] x Initial x-value of the vector.
 		/// @param[in] x Initial x-value of the vector.
 		/// @param[in] y Initial y-value of the vector.
 		/// @param[in] y Initial y-value of the vector.

+ 5 - 0
Include/RmlUi/Core/Vector2.inl

@@ -28,6 +28,11 @@
 
 
 namespace Rml {
 namespace Rml {
 
 
+// Default constructor.
+template <typename Type>
+Vector2<Type>::Vector2() : x{0}, y{0}
+{}
+
 // Initialising constructor.
 // Initialising constructor.
 template < typename Type >
 template < typename Type >
 Vector2< Type >::Vector2(Type v) : x(v), y(v)
 Vector2< Type >::Vector2(Type v) : x(v), y(v)

+ 3 - 1
Include/RmlUi/Core/Vector3.h

@@ -43,9 +43,11 @@ template < typename Type >
 class Vector3
 class Vector3
 {
 {
 	public:
 	public:
+		/// Default constructor.
+		inline Vector3();
 		/// Initialising constructor.
 		/// Initialising constructor.
 		/// @param[in] v Initial value of each element in the vector.
 		/// @param[in] v Initial value of each element in the vector.
-		explicit inline Vector3(Type v = Type{ 0 });
+		explicit inline Vector3(Type v);
 		/// Initialising constructor.
 		/// Initialising constructor.
 		/// @param[in] x Initial x-value of the vector.
 		/// @param[in] x Initial x-value of the vector.
 		/// @param[in] y Initial y-value of the vector.
 		/// @param[in] y Initial y-value of the vector.

+ 5 - 0
Include/RmlUi/Core/Vector3.inl

@@ -30,6 +30,11 @@
 
 
 namespace Rml {
 namespace Rml {
 
 
+// Default constructor.
+template <typename Type>
+Vector3<Type>::Vector3() : x{0}, y{0}, z{0}
+{}
+
 // Initialising constructor.
 // Initialising constructor.
 template < typename Type >
 template < typename Type >
 Vector3< Type >::Vector3(Type v) : x(v), y(v), z(v)
 Vector3< Type >::Vector3(Type v) : x(v), y(v), z(v)

+ 3 - 1
Include/RmlUi/Core/Vector4.h

@@ -44,9 +44,11 @@ template < typename Type >
 class Vector4
 class Vector4
 {
 {
 	public:
 	public:
+		/// Default constructor.
+		inline Vector4();
 		/// Initialising constructor.
 		/// Initialising constructor.
 		/// @param[in] v Initial value of each element in the vector.
 		/// @param[in] v Initial value of each element in the vector.
-		explicit inline Vector4(Type v = Type{ 0 });
+		explicit inline Vector4(Type v);
 		/// Initialising constructor.
 		/// Initialising constructor.
 		/// @param[in] x Initial x-value of the vector.
 		/// @param[in] x Initial x-value of the vector.
 		/// @param[in] y Initial y-value of the vector.
 		/// @param[in] y Initial y-value of the vector.

+ 5 - 0
Include/RmlUi/Core/Vector4.inl

@@ -30,6 +30,11 @@
 
 
 namespace Rml {
 namespace Rml {
 
 
+// Default constructor.
+template <typename Type>
+Vector4<Type>::Vector4() : x{0}, y{0}, z{0}, w{0}
+{}
+
 // Initialising constructor.
 // Initialising constructor.
 template < typename Type >
 template < typename Type >
 Vector4< Type >::Vector4(Type v) 
 Vector4< Type >::Vector4(Type v)