Browse Source

- Added constexpr for *vec*, *mat*, *quat* and *dual_quat* types #493

Christophe Riccio 9 years ago
parent
commit
d0c4bbaef7
3 changed files with 36 additions and 36 deletions
  1. 18 18
      glm/detail/type_mat2x2.hpp
  2. 17 17
      glm/detail/type_mat2x2.inl
  3. 1 1
      glm/gtx/dual_quaternion.inl

+ 18 - 18
glm/detail/type_mat2x2.hpp

@@ -55,45 +55,45 @@ namespace glm
 	public:
 	public:
 		// -- Constructors --
 		// -- Constructors --
 
 
-		GLM_FUNC_DECL GLM_CONSTEXPR tmat2x2() GLM_DEFAULT_CTOR;
-		GLM_FUNC_DECL GLM_CONSTEXPR tmat2x2(tmat2x2<T, P> const & m) GLM_DEFAULT;
+		GLM_FUNC_DECL tmat2x2() GLM_DEFAULT_CTOR;
+		GLM_FUNC_DECL tmat2x2(tmat2x2<T, P> const & m) GLM_DEFAULT;
 		template <precision Q>
 		template <precision Q>
-		GLM_FUNC_DECL GLM_CONSTEXPR tmat2x2(tmat2x2<T, Q> const & m);
+		GLM_FUNC_DECL tmat2x2(tmat2x2<T, Q> const & m);
 
 
 		GLM_FUNC_DECL GLM_CONSTEXPR explicit tmat2x2(ctor);
 		GLM_FUNC_DECL GLM_CONSTEXPR explicit tmat2x2(ctor);
-		GLM_FUNC_DECL GLM_CONSTEXPR explicit tmat2x2(T scalar);
-		GLM_FUNC_DECL GLM_CONSTEXPR tmat2x2(
+		GLM_FUNC_DECL explicit tmat2x2(T scalar);
+		GLM_FUNC_DECL tmat2x2(
 			T const & x1, T const & y1,
 			T const & x1, T const & y1,
 			T const & x2, T const & y2);
 			T const & x2, T const & y2);
-		GLM_FUNC_DECL GLM_CONSTEXPR tmat2x2(
+		GLM_FUNC_DECL tmat2x2(
 			col_type const & v1,
 			col_type const & v1,
 			col_type const & v2);
 			col_type const & v2);
 
 
 		// -- Conversions --
 		// -- Conversions --
 
 
 		template <typename U, typename V, typename M, typename N>
 		template <typename U, typename V, typename M, typename N>
-		GLM_FUNC_DECL GLM_CONSTEXPR tmat2x2(
+		GLM_FUNC_DECL tmat2x2(
 			U const & x1, V const & y1,
 			U const & x1, V const & y1,
 			M const & x2, N const & y2);
 			M const & x2, N const & y2);
 
 
 		template <typename U, typename V>
 		template <typename U, typename V>
-		GLM_FUNC_DECL GLM_CONSTEXPR tmat2x2(
+		GLM_FUNC_DECL tmat2x2(
 			tvec2<U, P> const & v1,
 			tvec2<U, P> const & v1,
 			tvec2<V, P> const & v2);
 			tvec2<V, P> const & v2);
 
 
 		// -- Matrix conversions --
 		// -- Matrix conversions --
 
 
 		template <typename U, precision Q>
 		template <typename U, precision Q>
-		GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x2(tmat2x2<U, Q> const & m);
-
-		GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x2(tmat3x3<T, P> const & x);
-		GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x2(tmat4x4<T, P> const & x);
-		GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x2(tmat2x3<T, P> const & x);
-		GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x2(tmat3x2<T, P> const & x);
-		GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x2(tmat2x4<T, P> const & x);
-		GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x2(tmat4x2<T, P> const & x);
-		GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x2(tmat3x4<T, P> const & x);
-		GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tmat2x2(tmat4x3<T, P> const & x);
+		GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat2x2<U, Q> const & m);
+
+		GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat3x3<T, P> const & x);
+		GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat4x4<T, P> const & x);
+		GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat2x3<T, P> const & x);
+		GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat3x2<T, P> const & x);
+		GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat2x4<T, P> const & x);
+		GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat4x2<T, P> const & x);
+		GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat3x4<T, P> const & x);
+		GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat4x3<T, P> const & x);
 
 
 		// -- Accesses --
 		// -- Accesses --
 
 

+ 17 - 17
glm/detail/type_mat2x2.inl

@@ -54,7 +54,7 @@ namespace detail
 
 
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
 		template <typename T, precision P>
 		template <typename T, precision P>
-		GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x2<T, P>::tmat2x2()
+		GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2()
 		{
 		{
 #			ifndef GLM_FORCE_NO_CTOR_INIT 
 #			ifndef GLM_FORCE_NO_CTOR_INIT 
 				this->value[0] = col_type(1, 0);
 				this->value[0] = col_type(1, 0);
@@ -65,7 +65,7 @@ namespace detail
 
 
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS
 		template <typename T, precision P>
 		template <typename T, precision P>
-		GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x2<T, P>::tmat2x2(tmat2x2<T, P> const & m)
+		GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<T, P> const & m)
 		{
 		{
 			this->value[0] = m.value[0];
 			this->value[0] = m.value[0];
 			this->value[1] = m.value[1];
 			this->value[1] = m.value[1];
@@ -74,7 +74,7 @@ namespace detail
 
 
 	template <typename T, precision P>
 	template <typename T, precision P>
 	template <precision Q>
 	template <precision Q>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x2<T, P>::tmat2x2(tmat2x2<T, Q> const & m)
+	GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<T, Q> const & m)
 	{
 	{
 		this->value[0] = m.value[0];
 		this->value[0] = m.value[0];
 		this->value[1] = m.value[1];
 		this->value[1] = m.value[1];
@@ -85,14 +85,14 @@ namespace detail
 	{}
 	{}
 
 
 	template <typename T, precision P>
 	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x2<T, P>::tmat2x2(T scalar)
+	GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(T scalar)
 	{
 	{
 		this->value[0] = col_type(scalar, 0);
 		this->value[0] = col_type(scalar, 0);
 		this->value[1] = col_type(0, scalar);
 		this->value[1] = col_type(0, scalar);
 	}
 	}
 
 
 	template <typename T, precision P>
 	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x2<T, P>::tmat2x2
+	GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
 	(
 	(
 		T const & x0, T const & y0,
 		T const & x0, T const & y0,
 		T const & x1, T const & y1
 		T const & x1, T const & y1
@@ -103,7 +103,7 @@ namespace detail
 	}
 	}
 
 
 	template <typename T, precision P>
 	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x2<T, P>::tmat2x2(col_type const & v0, col_type const & v1)
+	GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(col_type const & v0, col_type const & v1)
 	{
 	{
 		this->value[0] = v0;
 		this->value[0] = v0;
 		this->value[1] = v1;
 		this->value[1] = v1;
@@ -113,7 +113,7 @@ namespace detail
 
 
 	template <typename T, precision P>
 	template <typename T, precision P>
 	template <typename X1, typename Y1, typename X2, typename Y2>
 	template <typename X1, typename Y1, typename X2, typename Y2>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x2<T, P>::tmat2x2
+	GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
 	(
 	(
 		X1 const & x1, Y1 const & y1,
 		X1 const & x1, Y1 const & y1,
 		X2 const & x2, Y2 const & y2
 		X2 const & x2, Y2 const & y2
@@ -125,7 +125,7 @@ namespace detail
 	
 	
 	template <typename T, precision P>
 	template <typename T, precision P>
 	template <typename V1, typename V2>
 	template <typename V1, typename V2>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x2<T, P>::tmat2x2(tvec2<V1, P> const & v1, tvec2<V2, P> const & v2)
+	GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tvec2<V1, P> const & v1, tvec2<V2, P> const & v2)
 	{
 	{
 		this->value[0] = col_type(v1);
 		this->value[0] = col_type(v1);
 		this->value[1] = col_type(v2);
 		this->value[1] = col_type(v2);
@@ -135,63 +135,63 @@ namespace detail
 
 
 	template <typename T, precision P>
 	template <typename T, precision P>
 	template <typename U, precision Q>
 	template <typename U, precision Q>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x2<T, P>::tmat2x2(tmat2x2<U, Q> const & m)
+	GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<U, Q> const & m)
 	{
 	{
 		this->value[0] = col_type(m[0]);
 		this->value[0] = col_type(m[0]);
 		this->value[1] = col_type(m[1]);
 		this->value[1] = col_type(m[1]);
 	}
 	}
 
 
 	template <typename T, precision P>
 	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x2<T, P>::tmat2x2(tmat3x3<T, P> const & m)
+	GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat3x3<T, P> const & m)
 	{
 	{
 		this->value[0] = col_type(m[0]);
 		this->value[0] = col_type(m[0]);
 		this->value[1] = col_type(m[1]);
 		this->value[1] = col_type(m[1]);
 	}
 	}
 
 
 	template <typename T, precision P>
 	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x2<T, P>::tmat2x2(tmat4x4<T, P> const & m)
+	GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat4x4<T, P> const & m)
 	{
 	{
 		this->value[0] = col_type(m[0]);
 		this->value[0] = col_type(m[0]);
 		this->value[1] = col_type(m[1]);
 		this->value[1] = col_type(m[1]);
 	}
 	}
 
 
 	template <typename T, precision P> 
 	template <typename T, precision P> 
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x2<T, P>::tmat2x2(tmat2x3<T, P> const & m)
+	GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x3<T, P> const & m)
 	{
 	{
 		this->value[0] = col_type(m[0]);
 		this->value[0] = col_type(m[0]);
 		this->value[1] = col_type(m[1]);
 		this->value[1] = col_type(m[1]);
 	}
 	}
 
 
 	template <typename T, precision P>
 	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x2<T, P>::tmat2x2(tmat3x2<T, P> const & m)
+	GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat3x2<T, P> const & m)
 	{
 	{
 		this->value[0] = m[0];
 		this->value[0] = m[0];
 		this->value[1] = m[1];
 		this->value[1] = m[1];
 	}
 	}
 
 
 	template <typename T, precision P>
 	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x2<T, P>::tmat2x2(tmat2x4<T, P> const & m)
+	GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x4<T, P> const & m)
 	{
 	{
 		this->value[0] = col_type(m[0]);
 		this->value[0] = col_type(m[0]);
 		this->value[1] = col_type(m[1]);
 		this->value[1] = col_type(m[1]);
 	}
 	}
 
 
 	template <typename T, precision P>
 	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x2<T, P>::tmat2x2(tmat4x2<T, P> const & m)
+	GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat4x2<T, P> const & m)
 	{
 	{
 		this->value[0] = m[0];
 		this->value[0] = m[0];
 		this->value[1] = m[1];
 		this->value[1] = m[1];
 	}
 	}
 
 
 	template <typename T, precision P>
 	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x2<T, P>::tmat2x2(tmat3x4<T, P> const & m)
+	GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat3x4<T, P> const & m)
 	{
 	{
 		this->value[0] = col_type(m[0]);
 		this->value[0] = col_type(m[0]);
 		this->value[1] = col_type(m[1]);
 		this->value[1] = col_type(m[1]);
 	}
 	}
 
 
 	template <typename T, precision P>
 	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR tmat2x2<T, P>::tmat2x2(tmat4x3<T, P> const & m)
+	GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat4x3<T, P> const & m)
 	{
 	{
 		this->value[0] = col_type(m[0]);
 		this->value[0] = col_type(m[0]);
 		this->value[1] = col_type(m[1]);
 		this->value[1] = col_type(m[1]);

+ 1 - 1
glm/gtx/dual_quaternion.inl

@@ -71,7 +71,7 @@ namespace glm
 
 
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS
 		template <typename T, precision P>
 		template <typename T, precision P>
-		GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat<T, P>::tdualquat(tdualquat<T, P> const & d)
+		GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat(tdualquat<T, P> const & d)
 			: real(d.real)
 			: real(d.real)
 			, dual(d.dual)
 			, dual(d.dual)
 		{}
 		{}