Forráskód Böngészése

Added GLM_FORCE_SIZE_FUNC to replace .length() by .size() #245

Christophe Riccio 11 éve
szülő
commit
291708ce07

+ 3 - 1
glm/detail/setup.hpp

@@ -29,6 +29,7 @@
 #pragma once
 #pragma once
 
 
 #include <cassert>
 #include <cassert>
+#include <cstddef>
 
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // Version
 // Version
@@ -761,7 +762,8 @@
 
 
 namespace glm
 namespace glm
 {
 {
-#if defined(GLM_FORCE_SIZE_T_LENGTH)
+	typedef std::size_t size_t;
+#if defined(GLM_FORCE_SIZE_T_LENGTH) || defined(GLM_FORCE_SIZE_FUNC)
 	typedef std::size_t length_t;
 	typedef std::size_t length_t;
 #else
 #else
 	typedef int length_t;
 	typedef int length_t;

+ 4 - 0
glm/detail/type_mat2x2.hpp

@@ -47,7 +47,11 @@ namespace glm
 		typedef tmat2x2<T, P> type;
 		typedef tmat2x2<T, P> type;
 		typedef tmat2x2<T, P> transpose_type;
 		typedef tmat2x2<T, P> transpose_type;
 
 
+#if GLM_FORCE_SIZE_FUNC
+		GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+#else
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
+#endif//GLM_FORCE_SIZE_FUNC
 
 
 		template <typename U, precision Q>
 		template <typename U, precision Q>
 		friend tvec2<U, Q> operator/(tmat2x2<U, Q> const & m, tvec2<U, Q> const & v);
 		friend tvec2<U, Q> operator/(tmat2x2<U, Q> const & m, tvec2<U, Q> const & v);

+ 12 - 1
glm/detail/type_mat2x2.inl

@@ -46,8 +46,19 @@ namespace detail
 	}
 	}
 }//namespace detail
 }//namespace detail
 
 
+#if GLM_FORCE_SIZE_FUNC
 	template <typename T, precision P>
 	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat2x2<T, P>::length() const {return 2;}
+	GLM_FUNC_QUALIFIER GLM_CONSTEXPR size_t tmat2x2<T, P>::size() const
+	{
+		return 2;
+	}
+#else
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat2x2<T, P>::length() const
+	{
+		return 2;
+	}
+#endif
 
 
 	//////////////////////////////////////
 	//////////////////////////////////////
 	// Accesses
 	// Accesses

+ 4 - 0
glm/detail/type_mat2x3.hpp

@@ -48,7 +48,11 @@ namespace glm
 		typedef tmat2x3<T, P> type;
 		typedef tmat2x3<T, P> type;
 		typedef tmat3x2<T, P> transpose_type;
 		typedef tmat3x2<T, P> transpose_type;
 
 
+#if GLM_FORCE_SIZE_FUNC
+		GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+#else
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
+#endif//GLM_FORCE_SIZE_FUNC
 
 
 	private:
 	private:
 		// Data 
 		// Data 

+ 8 - 0
glm/detail/type_mat2x3.inl

@@ -28,11 +28,19 @@
 
 
 namespace glm
 namespace glm
 {
 {
+#if GLM_FORCE_SIZE_FUNC
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER GLM_CONSTEXPR size_t tmat2x3<T, P>::size() const
+	{
+		return 2;
+	}
+#else
 	template <typename T, precision P>
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat2x3<T, P>::length() const
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat2x3<T, P>::length() const
 	{
 	{
 		return 2;
 		return 2;
 	}
 	}
+#endif
 
 
 	//////////////////////////////////////
 	//////////////////////////////////////
 	// Accesses
 	// Accesses

+ 4 - 0
glm/detail/type_mat2x4.hpp

@@ -48,7 +48,11 @@ namespace glm
 		typedef tmat2x4<T, P> type;
 		typedef tmat2x4<T, P> type;
 		typedef tmat4x2<T, P> transpose_type;
 		typedef tmat4x2<T, P> transpose_type;
 
 
+#if GLM_FORCE_SIZE_FUNC
+		GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+#else
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
+#endif//GLM_FORCE_SIZE_FUNC
 
 
 	private:
 	private:
 		// Data 
 		// Data 

+ 8 - 0
glm/detail/type_mat2x4.inl

@@ -28,11 +28,19 @@
 
 
 namespace glm
 namespace glm
 {
 {
+#if GLM_FORCE_SIZE_FUNC
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER GLM_CONSTEXPR size_t tmat2x4<T, P>::size() const
+	{
+		return 2;
+	}
+#else
 	template <typename T, precision P>
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat2x4<T, P>::length() const
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat2x4<T, P>::length() const
 	{
 	{
 		return 2;
 		return 2;
 	}
 	}
+#endif
 
 
 	//////////////////////////////////////
 	//////////////////////////////////////
 	// Accesses
 	// Accesses

+ 4 - 0
glm/detail/type_mat3x2.hpp

@@ -48,7 +48,11 @@ namespace glm
 		typedef tmat3x2<T, P> type;
 		typedef tmat3x2<T, P> type;
 		typedef tmat2x3<T, P> transpose_type;
 		typedef tmat2x3<T, P> transpose_type;
 
 
+#if GLM_FORCE_SIZE_FUNC
+		GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+#else
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
+#endif//GLM_FORCE_SIZE_FUNC
 
 
 	private:
 	private:
 		// Data
 		// Data

+ 8 - 0
glm/detail/type_mat3x2.inl

@@ -28,11 +28,19 @@
 
 
 namespace glm
 namespace glm
 {
 {
+#if GLM_FORCE_SIZE_FUNC
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER GLM_CONSTEXPR size_t tmat3x2<T, P>::size() const
+	{
+		return 3;
+	}
+#else
 	template <typename T, precision P>
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat3x2<T, P>::length() const
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat3x2<T, P>::length() const
 	{
 	{
 		return 3;
 		return 3;
 	}
 	}
+#endif
 
 
 	//////////////////////////////////////
 	//////////////////////////////////////
 	// Accesses
 	// Accesses

+ 4 - 0
glm/detail/type_mat3x3.hpp

@@ -47,7 +47,11 @@ namespace glm
 		typedef tmat3x3<T, P> type;
 		typedef tmat3x3<T, P> type;
 		typedef tmat3x3<T, P> transpose_type;
 		typedef tmat3x3<T, P> transpose_type;
 
 
+#if GLM_FORCE_SIZE_FUNC
+		GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+#else
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
+#endif//GLM_FORCE_SIZE_FUNC
 
 
 		template <typename U, precision Q>
 		template <typename U, precision Q>
 		friend tvec3<U, Q> operator/(tmat3x3<U, Q> const & m, tvec3<U, Q> const & v);
 		friend tvec3<U, Q> operator/(tmat3x3<U, Q> const & m, tvec3<U, Q> const & v);

+ 8 - 0
glm/detail/type_mat3x3.inl

@@ -52,11 +52,19 @@ namespace detail
 	}
 	}
 }//namespace detail
 }//namespace detail
 
 
+#if GLM_FORCE_SIZE_FUNC
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER GLM_CONSTEXPR size_t tmat3x3<T, P>::size() const
+	{
+		return 3;
+	}
+#else
 	template <typename T, precision P>
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat3x3<T, P>::length() const
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat3x3<T, P>::length() const
 	{
 	{
 		return 3;
 		return 3;
 	}
 	}
+#endif
 
 
 	//////////////////////////////////////
 	//////////////////////////////////////
 	// Accesses
 	// Accesses

+ 5 - 1
glm/detail/type_mat3x4.hpp

@@ -42,13 +42,17 @@ namespace glm
 	{
 	{
 		enum ctor{_null};
 		enum ctor{_null};
 		typedef T value_type;
 		typedef T value_type;
-		typedef std::size_t size_type;
+		typedef size_t size_type;
 		typedef tvec4<T, P> col_type;
 		typedef tvec4<T, P> col_type;
 		typedef tvec3<T, P> row_type;
 		typedef tvec3<T, P> row_type;
 		typedef tmat3x4<T, P> type;
 		typedef tmat3x4<T, P> type;
 		typedef tmat4x3<T, P> transpose_type;
 		typedef tmat4x3<T, P> transpose_type;
 
 
+#if GLM_FORCE_SIZE_FUNC
+		GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+#else
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
+#endif//GLM_FORCE_SIZE_FUNC
 
 
 	private:
 	private:
 		// Data 
 		// Data 

+ 8 - 0
glm/detail/type_mat3x4.inl

@@ -28,11 +28,19 @@
 
 
 namespace glm
 namespace glm
 {
 {
+#if GLM_FORCE_SIZE_FUNC
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER GLM_CONSTEXPR size_t tmat3x4<T, P>::size() const
+	{
+		return 3;
+	}
+#else
 	template <typename T, precision P>
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat3x4<T, P>::length() const
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat3x4<T, P>::length() const
 	{
 	{
 		return 3;
 		return 3;
 	}
 	}
+#endif
 
 
 	//////////////////////////////////////
 	//////////////////////////////////////
 	// Accesses
 	// Accesses

+ 4 - 0
glm/detail/type_mat4x2.hpp

@@ -48,7 +48,11 @@ namespace glm
 		typedef tmat4x2<T, P> type;
 		typedef tmat4x2<T, P> type;
 		typedef tmat2x4<T, P> transpose_type;
 		typedef tmat2x4<T, P> transpose_type;
 
 
+#if GLM_FORCE_SIZE_FUNC
+		GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+#else
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
+#endif//GLM_FORCE_SIZE_FUNC
 
 
 	private:
 	private:
 		// Data 
 		// Data 

+ 8 - 0
glm/detail/type_mat4x2.inl

@@ -28,11 +28,19 @@
 
 
 namespace glm
 namespace glm
 {
 {
+#if GLM_FORCE_SIZE_FUNC
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER GLM_CONSTEXPR size_t tmat4x2<T, P>::size() const
+	{
+		return 4;
+	}
+#else
 	template <typename T, precision P>
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat4x2<T, P>::length() const
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat4x2<T, P>::length() const
 	{
 	{
 		return 4;
 		return 4;
 	}
 	}
+#endif
 
 
 	//////////////////////////////////////
 	//////////////////////////////////////
 	// Accesses
 	// Accesses

+ 4 - 0
glm/detail/type_mat4x3.hpp

@@ -48,7 +48,11 @@ namespace glm
 		typedef tmat4x3<T, P> type;
 		typedef tmat4x3<T, P> type;
 		typedef tmat3x4<T, P> transpose_type;
 		typedef tmat3x4<T, P> transpose_type;
 
 
+#if GLM_FORCE_SIZE_FUNC
+		GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+#else
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
+#endif//GLM_FORCE_SIZE_FUNC
 
 
 	private:
 	private:
 		// Data 
 		// Data 

+ 8 - 1
glm/detail/type_mat4x3.inl

@@ -28,11 +28,19 @@
 
 
 namespace glm
 namespace glm
 {
 {
+#if GLM_FORCE_SIZE_FUNC
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER GLM_CONSTEXPR size_t tmat4x3<T, P>::size() const
+	{
+		return 4;
+	}
+#else
 	template <typename T, precision P>
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat4x3<T, P>::length() const
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat4x3<T, P>::length() const
 	{
 	{
 		return 4;
 		return 4;
 	}
 	}
+#endif
 
 
 	//////////////////////////////////////
 	//////////////////////////////////////
 	// Accesses
 	// Accesses
@@ -699,4 +707,3 @@ namespace glm
 		return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
 		return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
 	}
 	}
 } //namespace glm
 } //namespace glm
-

+ 4 - 0
glm/detail/type_mat4x4.hpp

@@ -47,7 +47,11 @@ namespace glm
 		typedef tmat4x4<T, P> type;
 		typedef tmat4x4<T, P> type;
 		typedef tmat4x4<T, P> transpose_type;
 		typedef tmat4x4<T, P> transpose_type;
 
 
+#if GLM_FORCE_SIZE_FUNC
+		GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+#else
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
+#endif//GLM_FORCE_SIZE_FUNC
 
 
 		template <typename U, precision Q>
 		template <typename U, precision Q>
 		friend tvec4<U, Q> operator/(tmat4x4<U, Q> const & m, tvec4<U, Q> const & v);
 		friend tvec4<U, Q> operator/(tmat4x4<U, Q> const & m, tvec4<U, Q> const & v);

+ 8 - 0
glm/detail/type_mat4x4.inl

@@ -88,11 +88,19 @@ namespace detail
 	}
 	}
 }//namespace detail
 }//namespace detail
 
 
+#if GLM_FORCE_SIZE_FUNC
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER GLM_CONSTEXPR size_t tmat4x4<T, P>::size() const
+	{
+		return 4;
+	}
+#else
 	template <typename T, precision P>
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat4x4<T, P>::length() const
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat4x4<T, P>::length() const
 	{
 	{
 		return 4;
 		return 4;
 	}
 	}
+#endif
 
 
 	//////////////////////////////////////
 	//////////////////////////////////////
 	// Accesses
 	// Accesses

+ 6 - 0
glm/detail/type_vec1.hpp

@@ -56,7 +56,13 @@ namespace glm
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Helper
 		// Helper
 
 
+#if GLM_FORCE_SIZE_FUNC
+		/// Return the count of components of the vector
+		GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+#else
+		/// Return the count of components of the vector
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
+#endif//GLM_FORCE_SIZE_FUNC
 
 
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Data
 		// Data

+ 8 - 0
glm/detail/type_vec1.inl

@@ -28,11 +28,19 @@
 
 
 namespace glm
 namespace glm
 {
 {
+#if GLM_FORCE_SIZE_FUNC
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER GLM_CONSTEXPR size_t tvec1<T, P>::size() const
+	{
+		return 1;
+	}
+#else
 	template <typename T, precision P>
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tvec1<T, P>::length() const
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tvec1<T, P>::length() const
 	{
 	{
 		return 1;
 		return 1;
 	}
 	}
+#endif
 
 
 	//////////////////////////////////////
 	//////////////////////////////////////
 	// Accesses
 	// Accesses

+ 6 - 0
glm/detail/type_vec2.hpp

@@ -57,7 +57,13 @@ namespace glm
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Helper
 		// Helper
 
 
+#if GLM_FORCE_SIZE_FUNC
+		/// Return the count of components of the vector
+		GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+#else
+		/// Return the count of components of the vector
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
+#endif//GLM_FORCE_SIZE_FUNC
 
 
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Data
 		// Data

+ 8 - 0
glm/detail/type_vec2.inl

@@ -28,11 +28,19 @@
 
 
 namespace glm
 namespace glm
 {
 {
+#if GLM_FORCE_SIZE_FUNC
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER GLM_CONSTEXPR size_t tvec2<T, P>::size() const
+	{
+		return 2;
+	}
+#else
 	template <typename T, precision P>
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tvec2<T, P>::length() const
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tvec2<T, P>::length() const
 	{
 	{
 		return 2;
 		return 2;
 	}
 	}
+#endif
 
 
 	//////////////////////////////////////
 	//////////////////////////////////////
 	// Accesses
 	// Accesses

+ 6 - 0
glm/detail/type_vec3.hpp

@@ -57,7 +57,13 @@ namespace glm
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Helper
 		// Helper
 
 
+#if GLM_FORCE_SIZE_FUNC
+		/// Return the count of components of the vector
+		GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+#else
+		/// Return the count of components of the vector
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
+#endif//GLM_FORCE_SIZE_FUNC
 
 
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Data
 		// Data

+ 8 - 0
glm/detail/type_vec3.inl

@@ -28,11 +28,19 @@
 
 
 namespace glm
 namespace glm
 {
 {
+#if GLM_FORCE_SIZE_FUNC
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER GLM_CONSTEXPR size_t tvec3<T, P>::size() const
+	{
+		return 3;
+	}
+#else
 	template <typename T, precision P>
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tvec3<T, P>::length() const
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tvec3<T, P>::length() const
 	{
 	{
 		return 3;
 		return 3;
 	}
 	}
+#endif
 
 
 	//////////////////////////////////////
 	//////////////////////////////////////
 	// Accesses
 	// Accesses

+ 6 - 0
glm/detail/type_vec4.hpp

@@ -80,7 +80,13 @@ namespace glm
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Helper
 		// Helper
 
 
+#if GLM_FORCE_SIZE_FUNC
+		/// Return the count of components of the vector
+		GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+#else
+		/// Return the count of components of the vector
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
+#endif//GLM_FORCE_SIZE_FUNC
 
 
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Data
 		// Data

+ 8 - 0
glm/detail/type_vec4.inl

@@ -28,11 +28,19 @@
 
 
 namespace glm
 namespace glm
 {
 {
+#if GLM_FORCE_SIZE_FUNC
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER GLM_CONSTEXPR size_t tvec4<T, P>::size() const
+	{
+		return 4;
+	}
+#else
 	template <typename T, precision P>
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tvec4<T, P>::length() const
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tvec4<T, P>::length() const
 	{
 	{
 		return 4;
 		return 4;
 	}
 	}
+#endif
 
 
 	//////////////////////////////////////
 	//////////////////////////////////////
 	// Accesses
 	// Accesses

+ 6 - 0
glm/gtc/quaternion.hpp

@@ -66,7 +66,13 @@ namespace glm
 	public:
 	public:
 		T x, y, z, w;
 		T x, y, z, w;
 
 
+#if GLM_FORCE_SIZE_FUNC
+		/// Return the count of components of a quaternion
+		GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+#else
+		/// Return the count of components of a quaternion
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
+#endif//GLM_FORCE_SIZE_FUNC
 
 
 		// Constructors
 		// Constructors
 		GLM_FUNC_DECL tquat();
 		GLM_FUNC_DECL tquat();

+ 8 - 0
glm/gtc/quaternion.inl

@@ -45,11 +45,19 @@ namespace detail
 	};
 	};
 }//namespace detail
 }//namespace detail
 
 
+#if GLM_FORCE_SIZE_FUNC
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER GLM_CONSTEXPR size_t tquat<T, P>::size() const
+	{
+		return 4;
+	}
+#else
 	template <typename T, precision P>
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tquat<T, P>::length() const
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tquat<T, P>::length() const
 	{
 	{
 		return 4;
 		return 4;
 	}
 	}
+#endif
 
 
 	template <typename T, precision P>
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER tquat<T, P>::tquat() :
 	GLM_FUNC_QUALIFIER tquat<T, P>::tquat() :

+ 6 - 0
glm/gtx/dual_quaternion.hpp

@@ -64,7 +64,13 @@ namespace glm
 	public:
 	public:
 		glm::tquat<T, P> real, dual;
 		glm::tquat<T, P> real, dual;
 		
 		
+#if GLM_FORCE_SIZE_FUNC
+		/// Return the count of components of a dual quaternion
+		GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+#else
+		/// Return the count of components of a dual quaternion
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
 		GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
+#endif//GLM_FORCE_SIZE_FUNC
 		
 		
 		// Constructors
 		// Constructors
 		GLM_FUNC_DECL tdualquat();
 		GLM_FUNC_DECL tdualquat();

+ 8 - 0
glm/gtx/dual_quaternion.inl

@@ -31,11 +31,19 @@
 
 
 namespace glm
 namespace glm
 {
 {
+#if GLM_FORCE_SIZE_FUNC
+	template <typename T, precision P>
+	GLM_FUNC_QUALIFIER GLM_CONSTEXPR size_t tdualquat<T, P>::size() const
+	{
+		return 8;
+	}
+#else
 	template <typename T, precision P>
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tdualquat<T, P>::length() const
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tdualquat<T, P>::length() const
 	{
 	{
 		return 8;
 		return 8;
 	}
 	}
+#endif
 
 
 	template <typename T, precision P>
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat() :
 	GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat() :

+ 1 - 1
glm/gtx/rotate_vector.hpp

@@ -57,7 +57,7 @@ namespace glm
 	/// @param y A second vector
 	/// @param y A second vector
 	/// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1].
 	/// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1].
 	/// 
 	/// 
-	/// @see gtc_quaternion
+	/// @see gtx_rotate_vector
 	template <typename T, precision P>
 	template <typename T, precision P>
 	GLM_FUNC_DECL tvec3<T, P> slerp(
 	GLM_FUNC_DECL tvec3<T, P> slerp(
 		tvec3<T, P> const & x,
 		tvec3<T, P> const & x,

+ 1 - 0
readme.txt

@@ -60,6 +60,7 @@ GLM 0.9.6.0: 2014-XX-XX
 - Added GTX_range for C++ 11 compiler only #240
 - Added GTX_range for C++ 11 compiler only #240
 - Added Added closestPointOnLine function for tvec2 to GTX_closest_point #238
 - Added Added closestPointOnLine function for tvec2 to GTX_closest_point #238
 - Moved template types from 'detail' to 'glm' namespace #239, #244
 - Moved template types from 'detail' to 'glm' namespace #239, #244
+- Added GLM_FORCE_SIZE_FUNC to replace .length() by .size() #245
 
 
 ================================================================================
 ================================================================================
 GLM 0.9.5.4: 2014-06-21
 GLM 0.9.5.4: 2014-06-21