Browse Source

size_type and length_type for all types

Christophe Riccio 11 years ago
parent
commit
be0c5da488

+ 17 - 10
glm/detail/type_mat2x2.hpp

@@ -43,18 +43,11 @@ namespace glm
 	template <typename T, precision P = defaultp>
 	template <typename T, precision P = defaultp>
 	struct tmat2x2
 	struct tmat2x2
 	{
 	{
-		typedef T value_type;
-		typedef std::size_t size_type;
 		typedef tvec2<T, P> col_type;
 		typedef tvec2<T, P> col_type;
 		typedef tvec2<T, P> row_type;
 		typedef tvec2<T, P> row_type;
 		typedef tmat2x2<T, P> type;
 		typedef tmat2x2<T, P> type;
 		typedef tmat2x2<T, P> transpose_type;
 		typedef tmat2x2<T, P> transpose_type;
-
-#		ifdef GLM_FORCE_SIZE_FUNC
-			GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
-#		else
-			GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
-#		endif//GLM_FORCE_SIZE_FUNC
+		typedef T value_type;
 
 
 		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);
@@ -117,8 +110,22 @@ namespace glm
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Accesses
 		// Accesses
 
 
-		GLM_FUNC_DECL col_type & operator[](length_t i);
-		GLM_FUNC_DECL col_type const & operator[](length_t i) const;
+#		ifdef GLM_FORCE_SIZE_FUNC
+			typedef size_t size_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+
+			GLM_FUNC_DECL col_type & operator[](size_type i);
+			GLM_FUNC_DECL col_type const & operator[](size_type i) const;
+#		else
+			typedef length_t length_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
+
+			GLM_FUNC_DECL col_type & operator[](length_type i);
+			GLM_FUNC_DECL col_type const & operator[](length_type i) const;
+#		endif//GLM_FORCE_SIZE_FUNC
+
+		//////////////////////////////////////
+		// Unary arithmetic operators
 
 
 		template <typename U> 
 		template <typename U> 
 		GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<U, P> const & m);
 		GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<U, P> const & m);

+ 46 - 32
glm/detail/type_mat2x2.inl

@@ -50,37 +50,6 @@ namespace detail
 	}
 	}
 }//namespace detail
 }//namespace detail
 
 
-#ifdef GLM_FORCE_SIZE_FUNC
-	template <typename T, precision P>
-	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
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type & tmat2x2<T, P>::operator[](length_t i)
-	{
-		assert(i < this->length());
-		return this->value[i];
-	}
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type const & tmat2x2<T, P>::operator[](length_t i) const
-	{
-		assert(i < this->length());
-		return this->value[i];
-	}
-
 	//////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////
 	// Constructors
 	// Constructors
 
 
@@ -219,8 +188,53 @@ namespace detail
 		this->value[1] = col_type(m[1]);
 		this->value[1] = col_type(m[1]);
 	}
 	}
 
 
+	//////////////////////////////////////
+	// Accesses
+
+#	ifdef GLM_FORCE_SIZE_FUNC
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x2<T, P>::size_type tmat2x2<T, P>::size() const
+		{
+			return 2;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type & tmat2x2<T, P>::operator[](typename tmat2x2<T, P>::size_type i)
+		{
+			assert(i < this->size());
+			return this->value[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type const & tmat2x2<T, P>::operator[](typename tmat2x2<T, P>::size_type i) const
+		{
+			assert(i < this->size());
+			return this->value[i];
+		}
+#	else
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x2<T, P>::length_type tmat2x2<T, P>::length() const
+		{
+			return 2;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type & tmat2x2<T, P>::operator[](typename tmat2x2<T, P>::length_type i)
+		{
+			assert(i < this->length());
+			return this->value[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type const & tmat2x2<T, P>::operator[](typename tmat2x2<T, P>::length_type i) const
+		{
+			assert(i < this->length());
+			return this->value[i];
+		}
+#	endif//GLM_FORCE_SIZE_FUNC
+
 	//////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////
-	// mat2x2 operators
+	// Unary updatable operators
 
 
 	template <typename T, precision P>
 	template <typename T, precision P>
 	template <typename U>
 	template <typename U>

+ 19 - 10
glm/detail/type_mat2x3.hpp

@@ -44,18 +44,11 @@ namespace glm
 	template <typename T, precision P = defaultp>
 	template <typename T, precision P = defaultp>
 	struct tmat2x3
 	struct tmat2x3
 	{
 	{
-		typedef T value_type;
-		typedef std::size_t size_type;
 		typedef tvec3<T, P> col_type;
 		typedef tvec3<T, P> col_type;
 		typedef tvec2<T, P> row_type;
 		typedef tvec2<T, P> row_type;
 		typedef tmat2x3<T, P> type;
 		typedef tmat2x3<T, P> type;
 		typedef tmat3x2<T, P> transpose_type;
 		typedef tmat3x2<T, P> transpose_type;
-
-#		ifdef GLM_FORCE_SIZE_FUNC
-			GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
-#		else
-			GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
-#		endif//GLM_FORCE_SIZE_FUNC
+		typedef T value_type;
 
 
 	private:
 	private:
 		/// @cond DETAIL 
 		/// @cond DETAIL 
@@ -110,9 +103,25 @@ namespace glm
 		GLM_FUNC_DECL explicit tmat2x3(tmat4x2<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat2x3(tmat4x2<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat2x3(tmat4x3<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat2x3(tmat4x3<T, P> const & x);
 
 
+		//////////////////////////////////////
 		// Accesses
 		// Accesses
-		GLM_FUNC_DECL col_type & operator[](length_t i);
-		GLM_FUNC_DECL col_type const & operator[](length_t i) const;
+
+#		ifdef GLM_FORCE_SIZE_FUNC
+			typedef size_t size_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+
+			GLM_FUNC_DECL col_type & operator[](size_type i);
+			GLM_FUNC_DECL col_type const & operator[](size_type i) const;
+#		else
+			typedef length_t length_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
+
+			GLM_FUNC_DECL col_type & operator[](length_type i);
+			GLM_FUNC_DECL col_type const & operator[](length_type i) const;
+#		endif//GLM_FORCE_SIZE_FUNC
+
+		//////////////////////////////////////
+		// Unary arithmetic operators
 
 
 		template <typename U> 
 		template <typename U> 
 		GLM_FUNC_DECL tmat2x3<T, P> & operator=  (tmat2x3<U, P> const & m);
 		GLM_FUNC_DECL tmat2x3<T, P> & operator=  (tmat2x3<U, P> const & m);

+ 45 - 31
glm/detail/type_mat2x3.inl

@@ -32,37 +32,6 @@
 
 
 namespace glm
 namespace glm
 {
 {
-#ifdef 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>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat2x3<T, P>::length() const
-	{
-		return 2;
-	}
-#endif
-
-	//////////////////////////////////////
-	// Accesses
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type & tmat2x3<T, P>::operator[](length_t i)
-	{
-		assert(i < this->length());
-		return this->value[i];
-	}
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type const & tmat2x3<T, P>::operator[](length_t i) const
-	{
-		assert(i < this->length());
-		return this->value[i];
-	}
-
 	//////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////
 	// Constructors
 	// Constructors
 
 
@@ -203,6 +172,51 @@ namespace glm
 		this->value[1] = m[1];
 		this->value[1] = m[1];
 	}
 	}
 
 
+	//////////////////////////////////////
+	// Accesses
+
+#	ifdef GLM_FORCE_SIZE_FUNC
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x3<T, P>::size_type tmat2x3<T, P>::size() const
+		{
+			return 2;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type & tmat2x3<T, P>::operator[](typename tmat2x3<T, P>::size_type i)
+		{
+			assert(i < this->size());
+			return this->value[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type const & tmat2x3<T, P>::operator[](typename tmat2x3<T, P>::size_type i) const
+		{
+			assert(i < this->size());
+			return this->value[i];
+		}
+#	else
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x3<T, P>::length_type tmat2x3<T, P>::length() const
+		{
+			return 2;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type & tmat2x3<T, P>::operator[](typename tmat2x3<T, P>::length_type i)
+		{
+			assert(i < this->length());
+			return this->value[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type const & tmat2x3<T, P>::operator[](typename tmat2x3<T, P>::length_type i) const
+		{
+			assert(i < this->length());
+			return this->value[i];
+		}
+#	endif//GLM_FORCE_SIZE_FUNC
+
 	//////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////
 	// Unary updatable operators
 	// Unary updatable operators
 
 

+ 19 - 10
glm/detail/type_mat2x4.hpp

@@ -44,18 +44,11 @@ namespace glm
 	template <typename T, precision P = defaultp>
 	template <typename T, precision P = defaultp>
 	struct tmat2x4
 	struct tmat2x4
 	{
 	{
-		typedef T value_type;
-		typedef std::size_t size_type;
 		typedef tvec4<T, P> col_type;
 		typedef tvec4<T, P> col_type;
 		typedef tvec2<T, P> row_type;
 		typedef tvec2<T, P> row_type;
 		typedef tmat2x4<T, P> type;
 		typedef tmat2x4<T, P> type;
 		typedef tmat4x2<T, P> transpose_type;
 		typedef tmat4x2<T, P> transpose_type;
-
-#		ifdef GLM_FORCE_SIZE_FUNC
-			GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
-#		else
-			GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
-#		endif//GLM_FORCE_SIZE_FUNC
+		typedef T value_type;
 
 
 	private:
 	private:
 		/// @cond DETAIL
 		/// @cond DETAIL
@@ -111,9 +104,25 @@ namespace glm
 		GLM_FUNC_DECL explicit tmat2x4(tmat4x2<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat2x4(tmat4x2<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat2x4(tmat4x3<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat2x4(tmat4x3<T, P> const & x);
 
 
+		//////////////////////////////////////
 		// Accesses
 		// Accesses
-		GLM_FUNC_DECL col_type & operator[](length_t i);
-		GLM_FUNC_DECL col_type const & operator[](length_t i) const;
+
+#		ifdef GLM_FORCE_SIZE_FUNC
+			typedef size_t size_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+
+			GLM_FUNC_DECL col_type & operator[](size_type i);
+			GLM_FUNC_DECL col_type const & operator[](size_type i) const;
+#		else
+			typedef length_t length_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
+
+			GLM_FUNC_DECL col_type & operator[](length_type i);
+			GLM_FUNC_DECL col_type const & operator[](length_type i) const;
+#		endif//GLM_FORCE_SIZE_FUNC
+
+		//////////////////////////////////////
+		// Unary arithmetic operators
 
 
 		template <typename U> 
 		template <typename U> 
 		GLM_FUNC_DECL tmat2x4<T, P>& operator=  (tmat2x4<U, P> const & m);
 		GLM_FUNC_DECL tmat2x4<T, P>& operator=  (tmat2x4<U, P> const & m);

+ 45 - 31
glm/detail/type_mat2x4.inl

@@ -32,37 +32,6 @@
 
 
 namespace glm
 namespace glm
 {
 {
-#ifdef 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>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat2x4<T, P>::length() const
-	{
-		return 2;
-	}
-#endif
-
-	//////////////////////////////////////
-	// Accesses
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type & tmat2x4<T, P>::operator[](length_t i)
-	{
-		assert(i < this->length());
-		return this->value[i];
-	}
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type const & tmat2x4<T, P>::operator[](length_t i) const
-	{
-		assert(i < this->length());
-		return this->value[i];
-	}
-
 	//////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////
 	// Constructors
 	// Constructors
 
 
@@ -204,6 +173,51 @@ namespace glm
 		this->value[1] = col_type(m[1], 0);
 		this->value[1] = col_type(m[1], 0);
 	}
 	}
 
 
+	//////////////////////////////////////
+	// Accesses
+
+#	ifdef GLM_FORCE_SIZE_FUNC
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x4<T, P>::size_type tmat2x4<T, P>::size() const
+		{
+			return 2;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type & tmat2x4<T, P>::operator[](typename tmat2x4<T, P>::size_type i)
+		{
+			assert(i < this->size());
+			return this->value[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type const & tmat2x4<T, P>::operator[](typename tmat2x4<T, P>::size_type i) const
+		{
+			assert(i < this->size());
+			return this->value[i];
+		}
+#	else
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x4<T, P>::length_type tmat2x4<T, P>::length() const
+		{
+			return 2;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type & tmat2x4<T, P>::operator[](typename tmat2x4<T, P>::length_type i)
+		{
+			assert(i < this->length());
+			return this->value[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type const & tmat2x4<T, P>::operator[](typename tmat2x4<T, P>::length_type i) const
+		{
+			assert(i < this->length());
+			return this->value[i];
+		}
+#	endif//GLM_FORCE_SIZE_FUNC
+
 	//////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////
 	// Unary updatable operators
 	// Unary updatable operators
 
 

+ 19 - 10
glm/detail/type_mat3x2.hpp

@@ -44,18 +44,11 @@ namespace glm
 	template <typename T, precision P = defaultp>
 	template <typename T, precision P = defaultp>
 	struct tmat3x2
 	struct tmat3x2
 	{
 	{
-		typedef T value_type;
-		typedef std::size_t size_type;
 		typedef tvec2<T, P> col_type;
 		typedef tvec2<T, P> col_type;
 		typedef tvec3<T, P> row_type;
 		typedef tvec3<T, P> row_type;
 		typedef tmat3x2<T, P> type;
 		typedef tmat3x2<T, P> type;
 		typedef tmat2x3<T, P> transpose_type;
 		typedef tmat2x3<T, P> transpose_type;
-
-#		ifdef GLM_FORCE_SIZE_FUNC
-			GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
-#		else
-			GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
-#		endif//GLM_FORCE_SIZE_FUNC
+		typedef T value_type;
 
 
 	private:
 	private:
 		/// @cond DETAIL
 		/// @cond DETAIL
@@ -117,9 +110,25 @@ namespace glm
 		GLM_FUNC_DECL explicit tmat3x2(tmat4x2<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat3x2(tmat4x2<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat3x2(tmat4x3<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat3x2(tmat4x3<T, P> const & x);
 
 
+		//////////////////////////////////////
 		// Accesses
 		// Accesses
-		GLM_FUNC_DECL col_type & operator[](length_t i);
-		GLM_FUNC_DECL col_type const & operator[](length_t i) const;
+
+#		ifdef GLM_FORCE_SIZE_FUNC
+			typedef size_t size_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+
+			GLM_FUNC_DECL col_type & operator[](size_type i);
+			GLM_FUNC_DECL col_type const & operator[](size_type i) const;
+#		else
+			typedef length_t length_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
+
+			GLM_FUNC_DECL col_type & operator[](length_type i);
+			GLM_FUNC_DECL col_type const & operator[](length_type i) const;
+#		endif//GLM_FORCE_SIZE_FUNC
+
+		//////////////////////////////////////
+		// Unary arithmetic operators
 
 
 		template <typename U> 
 		template <typename U> 
 		GLM_FUNC_DECL tmat3x2<T, P> & operator=  (tmat3x2<U, P> const & m);
 		GLM_FUNC_DECL tmat3x2<T, P> & operator=  (tmat3x2<U, P> const & m);

+ 45 - 31
glm/detail/type_mat3x2.inl

@@ -32,37 +32,6 @@
 
 
 namespace glm
 namespace glm
 {
 {
-#ifdef 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>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat3x2<T, P>::length() const
-	{
-		return 3;
-	}
-#endif
-
-	//////////////////////////////////////
-	// Accesses
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type & tmat3x2<T, P>::operator[](length_t i)
-	{
-		assert(i < this->length());
-		return this->value[i];
-	}
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type const & tmat3x2<T, P>::operator[](length_t i) const
-	{
-		assert(i < this->length());
-		return this->value[i];
-	}
-
 	//////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////
 	// Constructors
 	// Constructors
 
 
@@ -232,6 +201,51 @@ namespace glm
 		this->value[2] = col_type(m[2]);
 		this->value[2] = col_type(m[2]);
 	}
 	}
 
 
+	//////////////////////////////////////
+	// Accesses
+
+#	ifdef GLM_FORCE_SIZE_FUNC
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x2<T, P>::size_type tmat3x2<T, P>::size() const
+		{
+			return 3;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type & tmat3x2<T, P>::operator[](typename tmat3x2<T, P>::size_type i)
+		{
+			assert(i < this->size());
+			return this->value[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type const & tmat3x2<T, P>::operator[](typename tmat3x2<T, P>::size_type i) const
+		{
+			assert(i < this->size());
+			return this->value[i];
+		}
+#	else
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x2<T, P>::length_type tmat3x2<T, P>::length() const
+		{
+			return 3;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type & tmat3x2<T, P>::operator[](typename tmat3x2<T, P>::length_type i)
+		{
+			assert(i < this->length());
+			return this->value[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type const & tmat3x2<T, P>::operator[](typename tmat3x2<T, P>::length_type i) const
+		{
+			assert(i < this->length());
+			return this->value[i];
+		}
+#	endif//GLM_FORCE_SIZE_FUNC
+
 	//////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////
 	// Unary updatable operators
 	// Unary updatable operators
 
 

+ 19 - 10
glm/detail/type_mat3x3.hpp

@@ -43,18 +43,11 @@ namespace glm
 	template <typename T, precision P = defaultp>
 	template <typename T, precision P = defaultp>
 	struct tmat3x3
 	struct tmat3x3
 	{
 	{
-		typedef T value_type;
-		typedef std::size_t size_type;
 		typedef tvec3<T, P> col_type;
 		typedef tvec3<T, P> col_type;
 		typedef tvec3<T, P> row_type;
 		typedef tvec3<T, P> row_type;
 		typedef tmat3x3<T, P> type;
 		typedef tmat3x3<T, P> type;
 		typedef tmat3x3<T, P> transpose_type;
 		typedef tmat3x3<T, P> transpose_type;
-
-#		ifdef GLM_FORCE_SIZE_FUNC
-			GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
-#		else
-			GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
-#		endif//GLM_FORCE_SIZE_FUNC
+		typedef T value_type;
 
 
 		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);
@@ -121,9 +114,25 @@ namespace glm
 		GLM_FUNC_DECL explicit tmat3x3(tmat3x4<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat3x3(tmat3x4<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat3x3(tmat4x3<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat3x3(tmat4x3<T, P> const & x);
 
 
+		//////////////////////////////////////
 		// Accesses
 		// Accesses
-		GLM_FUNC_DECL col_type & operator[](length_t i);
-		GLM_FUNC_DECL col_type const & operator[](length_t i) const;
+
+#		ifdef GLM_FORCE_SIZE_FUNC
+			typedef size_t size_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+
+			GLM_FUNC_DECL col_type & operator[](size_type i);
+			GLM_FUNC_DECL col_type const & operator[](size_type i) const;
+#		else
+			typedef length_t length_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
+
+			GLM_FUNC_DECL col_type & operator[](length_type i);
+			GLM_FUNC_DECL col_type const & operator[](length_type i) const;
+#		endif//GLM_FORCE_SIZE_FUNC
+
+		//////////////////////////////////////
+		// Unary arithmetic operators
 
 
 		template <typename U>
 		template <typename U>
 		GLM_FUNC_DECL tmat3x3<T, P>& operator=  (tmat3x3<U, P> const & m);
 		GLM_FUNC_DECL tmat3x3<T, P>& operator=  (tmat3x3<U, P> const & m);

+ 45 - 31
glm/detail/type_mat3x3.inl

@@ -56,37 +56,6 @@ namespace detail
 	}
 	}
 }//namespace detail
 }//namespace detail
 
 
-#ifdef 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>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat3x3<T, P>::length() const
-	{
-		return 3;
-	}
-#endif
-
-	//////////////////////////////////////
-	// Accesses
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type & tmat3x3<T, P>::operator[](length_t i)
-	{
-		assert(i < this->length());
-		return this->value[i];
-	}
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type const & tmat3x3<T, P>::operator[](length_t i) const
-	{
-		assert(i < this->length());
-		return this->value[i];
-	}
-
 	//////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////
 	// Constructors
 	// Constructors
 
 
@@ -256,6 +225,51 @@ namespace detail
 		this->value[2] = m[2];
 		this->value[2] = m[2];
 	}
 	}
 
 
+	//////////////////////////////////////
+	// Accesses
+
+#	ifdef GLM_FORCE_SIZE_FUNC
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x3<T, P>::size_type tmat3x3<T, P>::size() const
+		{
+			return 3;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type & tmat3x3<T, P>::operator[](typename tmat3x3<T, P>::size_type i)
+		{
+			assert(i < this->size());
+			return this->value[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type const & tmat3x3<T, P>::operator[](typename tmat3x3<T, P>::size_type i) const
+		{
+			assert(i < this->size());
+			return this->value[i];
+		}
+#	else
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x3<T, P>::length_type tmat3x3<T, P>::length() const
+		{
+			return 3;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type & tmat3x3<T, P>::operator[](typename tmat3x3<T, P>::length_type i)
+		{
+			assert(i < this->length());
+			return this->value[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type const & tmat3x3<T, P>::operator[](typename tmat3x3<T, P>::length_type i) const
+		{
+			assert(i < this->length());
+			return this->value[i];
+		}
+#	endif//GLM_FORCE_SIZE_FUNC
+
 	//////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////
 	// Operators
 	// Operators
 
 

+ 19 - 10
glm/detail/type_mat3x4.hpp

@@ -44,18 +44,11 @@ namespace glm
 	template <typename T, precision P = defaultp>
 	template <typename T, precision P = defaultp>
 	struct tmat3x4
 	struct tmat3x4
 	{
 	{
-		typedef T value_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;
-
-#		ifdef GLM_FORCE_SIZE_FUNC
-			GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
-#		else
-			GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
-#		endif//GLM_FORCE_SIZE_FUNC
+		typedef T value_type;
 
 
 	private:
 	private:
 		/// @cond DETAIL
 		/// @cond DETAIL
@@ -116,9 +109,25 @@ namespace glm
 		GLM_FUNC_DECL explicit tmat3x4(tmat4x2<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat3x4(tmat4x2<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat3x4(tmat4x3<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat3x4(tmat4x3<T, P> const & x);
 
 
+		//////////////////////////////////////
 		// Accesses
 		// Accesses
-		GLM_FUNC_DECL col_type & operator[](length_t i);
-		GLM_FUNC_DECL col_type const & operator[](length_t i) const;
+
+#		ifdef GLM_FORCE_SIZE_FUNC
+			typedef size_t size_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+
+			GLM_FUNC_DECL col_type & operator[](size_type i);
+			GLM_FUNC_DECL col_type const & operator[](size_type i) const;
+#		else
+			typedef length_t length_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
+
+			GLM_FUNC_DECL col_type & operator[](length_type i);
+			GLM_FUNC_DECL col_type const & operator[](length_type i) const;
+#		endif//GLM_FORCE_SIZE_FUNC
+
+		//////////////////////////////////////
+		// Unary arithmetic operators
 
 
 		template <typename U> 
 		template <typename U> 
 		GLM_FUNC_DECL tmat3x4<T, P> & operator=(tmat3x4<U, P> const & m);
 		GLM_FUNC_DECL tmat3x4<T, P> & operator=(tmat3x4<U, P> const & m);

+ 45 - 31
glm/detail/type_mat3x4.inl

@@ -32,37 +32,6 @@
 
 
 namespace glm
 namespace glm
 {
 {
-#ifdef 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>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat3x4<T, P>::length() const
-	{
-		return 3;
-	}
-#endif
-
-	//////////////////////////////////////
-	// Accesses
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type & tmat3x4<T, P>::operator[](length_t i)
-	{
-		assert(i < this->length());
-		return this->value[i];
-	}
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type const & tmat3x4<T, P>::operator[](length_t i) const
-	{
-		assert(i < this->length());
-		return this->value[i];
-	}
-
 	//////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////
 	// Constructors
 	// Constructors
 
 
@@ -231,6 +200,51 @@ namespace glm
 		this->value[2] = col_type(m[2], 0);
 		this->value[2] = col_type(m[2], 0);
 	}
 	}
 
 
+	//////////////////////////////////////
+	// Accesses
+
+#	ifdef GLM_FORCE_SIZE_FUNC
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x4<T, P>::size_type tmat3x4<T, P>::size() const
+		{
+			return 3;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type & tmat3x4<T, P>::operator[](typename tmat3x4<T, P>::size_type i)
+		{
+			assert(i < this->size());
+			return this->value[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type const & tmat3x4<T, P>::operator[](typename tmat3x4<T, P>::size_type i) const
+		{
+			assert(i < this->size());
+			return this->value[i];
+		}
+#	else
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x4<T, P>::length_type tmat3x4<T, P>::length() const
+		{
+			return 3;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type & tmat3x4<T, P>::operator[](typename tmat3x4<T, P>::length_type i)
+		{
+			assert(i < this->length());
+			return this->value[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type const & tmat3x4<T, P>::operator[](typename tmat3x4<T, P>::length_type i) const
+		{
+			assert(i < this->length());
+			return this->value[i];
+		}
+#	endif//GLM_FORCE_SIZE_FUNC
+
 	//////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////
 	// Unary updatable operators
 	// Unary updatable operators
 
 

+ 19 - 10
glm/detail/type_mat4x2.hpp

@@ -44,18 +44,11 @@ namespace glm
 	template <typename T, precision P = defaultp>
 	template <typename T, precision P = defaultp>
 	struct tmat4x2
 	struct tmat4x2
 	{
 	{
-		typedef T value_type;
-		typedef std::size_t size_type;
 		typedef tvec2<T, P> col_type;
 		typedef tvec2<T, P> col_type;
 		typedef tvec4<T, P> row_type;
 		typedef tvec4<T, P> row_type;
 		typedef tmat4x2<T, P> type;
 		typedef tmat4x2<T, P> type;
 		typedef tmat2x4<T, P> transpose_type;
 		typedef tmat2x4<T, P> transpose_type;
-
-#		ifdef GLM_FORCE_SIZE_FUNC
-			GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
-#		else
-			GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
-#		endif//GLM_FORCE_SIZE_FUNC
+		typedef T value_type;
 
 
 	private:
 	private:
 		/// @cond DETAIL
 		/// @cond DETAIL
@@ -122,9 +115,25 @@ namespace glm
 		GLM_FUNC_DECL explicit tmat4x2(tmat4x3<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat4x2(tmat4x3<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat4x2(tmat3x4<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat4x2(tmat3x4<T, P> const & x);
 
 
+		//////////////////////////////////////
 		// Accesses
 		// Accesses
-		GLM_FUNC_DECL col_type & operator[](length_t i);
-		GLM_FUNC_DECL col_type const & operator[](length_t i) const;
+
+#		ifdef GLM_FORCE_SIZE_FUNC
+			typedef size_t size_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+
+			GLM_FUNC_DECL col_type & operator[](size_type i);
+			GLM_FUNC_DECL col_type const & operator[](size_type i) const;
+#		else
+			typedef length_t length_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
+
+			GLM_FUNC_DECL col_type & operator[](length_type i);
+			GLM_FUNC_DECL col_type const & operator[](length_type i) const;
+#		endif//GLM_FORCE_SIZE_FUNC
+
+		//////////////////////////////////////
+		// Unary arithmetic operators
 
 
 		template <typename U> 
 		template <typename U> 
 		GLM_FUNC_DECL tmat4x2<T, P>& operator=(tmat4x2<U, P> const & m);
 		GLM_FUNC_DECL tmat4x2<T, P>& operator=(tmat4x2<U, P> const & m);

+ 45 - 31
glm/detail/type_mat4x2.inl

@@ -32,37 +32,6 @@
 
 
 namespace glm
 namespace glm
 {
 {
-#ifdef 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>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat4x2<T, P>::length() const
-	{
-		return 4;
-	}
-#endif
-
-	//////////////////////////////////////
-	// Accesses
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type & tmat4x2<T, P>::operator[](length_t i)
-	{
-		assert(i < this->length());
-		return this->value[i];
-	}
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type const & tmat4x2<T, P>::operator[](length_t i) const
-	{
-		assert(i < this->length());
-		return this->value[i];
-	}
-
 	//////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////
 	// Constructors
 	// Constructors
 
 
@@ -254,6 +223,51 @@ namespace glm
 		this->value[3] = col_type(0);
 		this->value[3] = col_type(0);
 	}
 	}
 
 
+	//////////////////////////////////////
+	// Accesses
+
+#	ifdef GLM_FORCE_SIZE_FUNC
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x2<T, P>::size_type tmat4x2<T, P>::size() const
+		{
+			return 4;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type & tmat4x2<T, P>::operator[](typename tmat4x2<T, P>::size_type i)
+		{
+			assert(i < this->size());
+			return this->value[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type const & tmat4x2<T, P>::operator[](typename tmat4x2<T, P>::size_type i) const
+		{
+			assert(i < this->size());
+			return this->value[i];
+		}
+#	else
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x2<T, P>::length_type tmat4x2<T, P>::length() const
+		{
+			return 4;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type & tmat4x2<T, P>::operator[](typename tmat4x2<T, P>::length_type i)
+		{
+			assert(i < this->length());
+			return this->value[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type const & tmat4x2<T, P>::operator[](typename tmat4x2<T, P>::length_type i) const
+		{
+			assert(i < this->length());
+			return this->value[i];
+		}
+#	endif//GLM_FORCE_SIZE_FUNC
+
 	//////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////
 	// Unary updatable operators
 	// Unary updatable operators
 
 

+ 19 - 10
glm/detail/type_mat4x3.hpp

@@ -44,18 +44,11 @@ namespace glm
 	template <typename T, precision P = defaultp>
 	template <typename T, precision P = defaultp>
 	struct tmat4x3
 	struct tmat4x3
 	{
 	{
-		typedef T value_type;
-		typedef std::size_t size_type;
 		typedef tvec3<T, P> col_type;
 		typedef tvec3<T, P> col_type;
 		typedef tvec4<T, P> row_type;
 		typedef tvec4<T, P> row_type;
 		typedef tmat4x3<T, P> type;
 		typedef tmat4x3<T, P> type;
 		typedef tmat3x4<T, P> transpose_type;
 		typedef tmat3x4<T, P> transpose_type;
-
-#		ifdef GLM_FORCE_SIZE_FUNC
-			GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
-#		else
-			GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
-#		endif//GLM_FORCE_SIZE_FUNC
+		typedef T value_type;
 
 
 	private:
 	private:
 		// Data 
 		// Data 
@@ -121,9 +114,25 @@ namespace glm
 		GLM_FUNC_DECL explicit tmat4x3(tmat4x2<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat4x3(tmat4x2<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat4x3(tmat3x4<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat4x3(tmat3x4<T, P> const & x);
 
 
+		//////////////////////////////////////
 		// Accesses
 		// Accesses
-		GLM_FUNC_DECL col_type & operator[](size_type i);
-		GLM_FUNC_DECL col_type const & operator[](size_type i) const;
+
+#		ifdef GLM_FORCE_SIZE_FUNC
+			typedef size_t size_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+
+			GLM_FUNC_DECL col_type & operator[](size_type i);
+			GLM_FUNC_DECL col_type const & operator[](size_type i) const;
+#		else
+			typedef length_t length_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
+
+			GLM_FUNC_DECL col_type & operator[](length_type i);
+			GLM_FUNC_DECL col_type const & operator[](length_type i) const;
+#		endif//GLM_FORCE_SIZE_FUNC
+
+		//////////////////////////////////////
+		// Unary arithmetic operators
 
 
 		template <typename U>
 		template <typename U>
 		GLM_FUNC_DECL tmat4x3<T, P> & operator=(tmat4x3<U, P> const & m);
 		GLM_FUNC_DECL tmat4x3<T, P> & operator=(tmat4x3<U, P> const & m);

+ 45 - 31
glm/detail/type_mat4x3.inl

@@ -32,37 +32,6 @@
 
 
 namespace glm
 namespace glm
 {
 {
-#ifdef 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>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat4x3<T, P>::length() const
-	{
-		return 4;
-	}
-#endif
-
-	//////////////////////////////////////
-	// Accesses
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type & tmat4x3<T, P>::operator[](size_type i)
-	{
-		assert(i < this->length());
-		return this->value[i];
-	}
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type const & tmat4x3<T, P>::operator[](size_type i) const
-	{
-		assert(i < this->length());
-		return this->value[i];
-	}
-
 	//////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////
 	// Constructors
 	// Constructors
 
 
@@ -254,6 +223,51 @@ namespace glm
 		this->value[3] = col_type(0);
 		this->value[3] = col_type(0);
 	}
 	}
 
 
+	//////////////////////////////////////
+	// Accesses
+
+#	ifdef GLM_FORCE_SIZE_FUNC
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x3<T, P>::size_type tmat4x3<T, P>::size() const
+		{
+			return 4;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type & tmat4x3<T, P>::operator[](typename tmat4x3<T, P>::size_type i)
+		{
+			assert(i < this->size());
+			return this->value[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type const & tmat4x3<T, P>::operator[](typename tmat4x3<T, P>::size_type i) const
+		{
+			assert(i < this->size());
+			return this->value[i];
+		}
+#	else
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x3<T, P>::length_type tmat4x3<T, P>::length() const
+		{
+			return 4;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type & tmat4x3<T, P>::operator[](typename tmat4x3<T, P>::length_type i)
+		{
+			assert(i < this->length());
+			return this->value[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type const & tmat4x3<T, P>::operator[](typename tmat4x3<T, P>::length_type i) const
+		{
+			assert(i < this->length());
+			return this->value[i];
+		}
+#	endif//GLM_FORCE_SIZE_FUNC
+
 	//////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////
 	// Unary updatable operators
 	// Unary updatable operators
 
 

+ 19 - 12
glm/detail/type_mat4x4.hpp

@@ -43,18 +43,11 @@ namespace glm
 	template <typename T, precision P = defaultp>
 	template <typename T, precision P = defaultp>
 	struct tmat4x4
 	struct tmat4x4
 	{
 	{
-		typedef T value_type;
-		typedef std::size_t size_type;
 		typedef tvec4<T, P> col_type;
 		typedef tvec4<T, P> col_type;
 		typedef tvec4<T, P> row_type;
 		typedef tvec4<T, P> row_type;
 		typedef tmat4x4<T, P> type;
 		typedef tmat4x4<T, P> type;
 		typedef tmat4x4<T, P> transpose_type;
 		typedef tmat4x4<T, P> transpose_type;
-
-#		ifdef GLM_FORCE_SIZE_FUNC
-			GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
-#		else
-			GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
-#		endif//GLM_FORCE_SIZE_FUNC
+		typedef T value_type;
 
 
 		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);
@@ -69,7 +62,6 @@ namespace glm
 	public:
 	public:
 		// Constructors
 		// Constructors
 		GLM_FUNC_DECL tmat4x4();
 		GLM_FUNC_DECL tmat4x4();
-		//GLM_FUNC_DECL tmat4x4(tmat4x4<T, P> const & m);
 		template <precision Q>
 		template <precision Q>
 		GLM_FUNC_DECL tmat4x4(tmat4x4<T, Q> const & m);
 		GLM_FUNC_DECL tmat4x4(tmat4x4<T, Q> const & m);
 
 
@@ -127,11 +119,26 @@ namespace glm
 		GLM_FUNC_DECL explicit tmat4x4(tmat3x4<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat4x4(tmat3x4<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat4x4(tmat4x3<T, P> const & x);
 		GLM_FUNC_DECL explicit tmat4x4(tmat4x3<T, P> const & x);
 
 
+		//////////////////////////////////////
 		// Accesses
 		// Accesses
-		GLM_FUNC_DECL col_type & operator[](length_t i);
-		GLM_FUNC_DECL col_type const & operator[](length_t i) const;
 
 
-		//GLM_FUNC_DECL tmat4x4<T, P> & operator=(tmat4x4<T, P> const & m);
+#		ifdef GLM_FORCE_SIZE_FUNC
+			typedef size_t size_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
+
+			GLM_FUNC_DECL col_type & operator[](size_type i);
+			GLM_FUNC_DECL col_type const & operator[](size_type i) const;
+#		else
+			typedef length_t length_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
+
+			GLM_FUNC_DECL col_type & operator[](length_type i);
+			GLM_FUNC_DECL col_type const & operator[](length_type i) const;
+#		endif//GLM_FORCE_SIZE_FUNC
+
+		//////////////////////////////////////
+		// Unary arithmetic operators
+
 		template <typename U>
 		template <typename U>
 		GLM_FUNC_DECL tmat4x4<T, P> & operator=(tmat4x4<U, P> const & m);
 		GLM_FUNC_DECL tmat4x4<T, P> & operator=(tmat4x4<U, P> const & m);
 		template <typename U>
 		template <typename U>

+ 45 - 31
glm/detail/type_mat4x4.inl

@@ -92,37 +92,6 @@ namespace detail
 	}
 	}
 }//namespace detail
 }//namespace detail
 
 
-#ifdef 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>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat4x4<T, P>::length() const
-	{
-		return 4;
-	}
-#endif
-
-	//////////////////////////////////////
-	// Accesses
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type & tmat4x4<T, P>::operator[](length_t i)
-	{
-		assert(i < this->length());
-		return this->value[i];
-	}
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type const & tmat4x4<T, P>::operator[](length_t i) const
-	{
-		assert(i < this->length());
-		return this->value[i];
-	}
-
 	//////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////
 	// Constructors
 	// Constructors
 
 
@@ -340,6 +309,51 @@ namespace detail
 		this->value[3] = col_type(m[3], 1);
 		this->value[3] = col_type(m[3], 1);
 	}
 	}
 
 
+	//////////////////////////////////////
+	// Accesses
+
+#	ifdef GLM_FORCE_SIZE_FUNC
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x4<T, P>::size_type tmat4x4<T, P>::size() const
+		{
+			return 4;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type & tmat4x4<T, P>::operator[](typename tmat4x4<T, P>::size_type i)
+		{
+			assert(i < this->size());
+			return this->value[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type const & tmat4x4<T, P>::operator[](typename tmat4x4<T, P>::size_type i) const
+		{
+			assert(i < this->size());
+			return this->value[i];
+		}
+#	else
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x4<T, P>::length_type tmat4x4<T, P>::length() const
+		{
+			return 4;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type & tmat4x4<T, P>::operator[](typename tmat4x4<T, P>::length_type i)
+		{
+			assert(i < this->length());
+			return this->value[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type const & tmat4x4<T, P>::operator[](typename tmat4x4<T, P>::length_type i) const
+		{
+			assert(i < this->length());
+			return this->value[i];
+		}
+#	endif//GLM_FORCE_SIZE_FUNC
+
 	//////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////
 	// Operators
 	// Operators
 
 

+ 15 - 13
glm/detail/type_vec1.hpp

@@ -55,17 +55,6 @@ namespace glm
 		typedef tvec1<bool, P> bool_type;
 		typedef tvec1<bool, P> bool_type;
 		typedef T value_type;
 		typedef T value_type;
 
 
-		//////////////////////////////////////
-		// Helper
-
-#		ifdef 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;
-#		endif//GLM_FORCE_SIZE_FUNC
-
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Data
 		// Data
 
 
@@ -99,8 +88,21 @@ namespace glm
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Accesses
 		// Accesses
 
 
-		GLM_FUNC_DECL T & operator[](length_t i);
-		GLM_FUNC_DECL T const & operator[](length_t i) const;
+#		ifdef GLM_FORCE_SIZE_FUNC
+			/// Return the count of components of the vector
+			typedef size_t size_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const;
+
+			GLM_FUNC_DECL T & operator[](size_type i);
+			GLM_FUNC_DECL T const & operator[](size_type i) const;
+#		else
+			/// Return the count of components of the vector
+			typedef length_t length_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
+
+			GLM_FUNC_DECL T & operator[](length_type i);
+			GLM_FUNC_DECL T const & operator[](length_type i) const;
+#		endif//GLM_FORCE_SIZE_FUNC
 
 
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Implicit basic constructors
 		// Implicit basic constructors

+ 46 - 32
glm/detail/type_vec1.inl

@@ -32,43 +32,12 @@
 
 
 namespace glm
 namespace glm
 {
 {
-#ifdef 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>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tvec1<T, P>::length() const
-	{
-		return 1;
-	}
-#endif
-
-	//////////////////////////////////////
-	// Accesses
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER T & tvec1<T, P>::operator[](length_t i)
-	{
-		assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
-		return (&x)[i];
-	}
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER T const & tvec1<T, P>::operator[](length_t i) const
-	{
-		assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
-		return (&x)[i];
-	}
-
 	//////////////////////////////////////
 	//////////////////////////////////////
 	// Implicit basic constructors
 	// Implicit basic constructors
 
 
 	template <typename T, precision P>
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1()
 	GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1()
-#		ifndef GLM_FORCE_NO_CTOR_INIT 
+#		ifndef GLM_FORCE_NO_CTOR_INIT
 			: x(0)
 			: x(0)
 #		endif
 #		endif
 	{}
 	{}
@@ -118,6 +87,51 @@ namespace glm
 		: x(static_cast<T>(v.x))
 		: x(static_cast<T>(v.x))
 	{}
 	{}
 
 
+	//////////////////////////////////////
+	// Component accesses
+
+#	ifdef GLM_FORCE_SIZE_FUNC
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec1<T, P>::size_type tvec1<T, P>::size() const
+		{
+			return 1;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER T & tvec1<T, P>::operator[](typename tvec1<T, P>::size_type i)
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&x)[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER T const & tvec1<T, P>::operator[](typename tvec1<T, P>::size_type i) const
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&x)[i];
+		}
+#	else
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec1<T, P>::length_type tvec1<T, P>::length() const
+		{
+			return 1;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER T & tvec1<T, P>::operator[](typename tvec1<T, P>::length_type i)
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&x)[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER T const & tvec1<T, P>::operator[](typename tvec1<T, P>::length_type i) const
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&x)[i];
+		}
+#	endif//GLM_FORCE_SIZE_FUNC
+
 	//////////////////////////////////////
 	//////////////////////////////////////
 	// Unary arithmetic operators
 	// Unary arithmetic operators
 
 

+ 16 - 15
glm/detail/type_vec2.hpp

@@ -54,18 +54,6 @@ namespace glm
 		typedef tvec2<T, P> type;
 		typedef tvec2<T, P> type;
 		typedef tvec2<bool, P> bool_type;
 		typedef tvec2<bool, P> bool_type;
 		typedef T value_type;
 		typedef T value_type;
-		typedef int size_type;
-
-		//////////////////////////////////////
-		// Helper
-
-#		ifdef 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;
-#		endif//GLM_FORCE_SIZE_FUNC
 
 
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Data
 		// Data
@@ -99,10 +87,23 @@ namespace glm
 #		endif
 #		endif
 
 
 		//////////////////////////////////////
 		//////////////////////////////////////
-		// Accesses
+		// Component accesses
 
 
-		GLM_FUNC_DECL T & operator[](length_t i);
-		GLM_FUNC_DECL T const & operator[](length_t i) const;
+#		ifdef GLM_FORCE_SIZE_FUNC
+			/// Return the count of components of the vector
+			typedef size_t size_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const;
+
+			GLM_FUNC_DECL T & operator[](size_type i);
+			GLM_FUNC_DECL T const & operator[](size_type i) const;
+#		else
+			/// Return the count of components of the vector
+			typedef length_t length_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
+
+			GLM_FUNC_DECL T & operator[](length_type i);
+			GLM_FUNC_DECL T const & operator[](length_type i) const;
+#		endif//GLM_FORCE_SIZE_FUNC
 
 
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Implicit basic constructors
 		// Implicit basic constructors

+ 48 - 34
glm/detail/type_vec2.inl

@@ -32,44 +32,13 @@
 
 
 namespace glm
 namespace glm
 {
 {
-#ifdef 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>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tvec2<T, P>::length() const
-	{
-		return 2;
-	}
-#endif
-
-	//////////////////////////////////////
-	// Accesses
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER T & tvec2<T, P>::operator[](length_t i)
-	{
-		assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
-		return (&x)[i];
-	}
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER T const & tvec2<T, P>::operator[](length_t i) const
-	{
-		assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
-		return (&x)[i];
-	}
-
 	//////////////////////////////////////
 	//////////////////////////////////////
 	// Implicit basic constructors
 	// Implicit basic constructors
 
 
 	template <typename T, precision P>
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2()
 	GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2()
 #		ifndef GLM_FORCE_NO_CTOR_INIT
 #		ifndef GLM_FORCE_NO_CTOR_INIT
-			: x(0), y(0) 
+			: x(0), y(0)
 #		endif
 #		endif
 	{}
 	{}
 
 
@@ -92,8 +61,8 @@ namespace glm
 	{}
 	{}
 
 
 	template <typename T, precision P>
 	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(T const & s1, T const & s2)
-		: x(s1), y(s2)
+	GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(T const & a, T const & b)
+		: x(a), y(b)
 	{}
 	{}
 
 
 	//////////////////////////////////////
 	//////////////////////////////////////
@@ -137,6 +106,51 @@ namespace glm
 		, y(static_cast<T>(v.y))
 		, y(static_cast<T>(v.y))
 	{}
 	{}
 
 
+	//////////////////////////////////////
+	// Component accesses
+
+#	ifdef GLM_FORCE_SIZE_FUNC
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec2<T, P>::size_type tvec2<T, P>::size() const
+		{
+			return 2;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER T & tvec2<T, P>::operator[](typename tvec2<T, P>::size_type i)
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&x)[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER T const & tvec2<T, P>::operator[](typename tvec2<T, P>::size_type i) const
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&x)[i];
+		}
+#	else
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec2<T, P>::length_type tvec2<T, P>::length() const
+		{
+			return 2;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER T & tvec2<T, P>::operator[](typename tvec2<T, P>::length_type i)
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&x)[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER T const & tvec2<T, P>::operator[](typename tvec2<T, P>::length_type i) const
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&x)[i];
+		}
+#	endif//GLM_FORCE_SIZE_FUNC
+
 	//////////////////////////////////////
 	//////////////////////////////////////
 	// Unary arithmetic operators
 	// Unary arithmetic operators
 
 

+ 16 - 15
glm/detail/type_vec3.hpp

@@ -54,18 +54,6 @@ namespace glm
 		typedef tvec3<T, P> type;
 		typedef tvec3<T, P> type;
 		typedef tvec3<bool, P> bool_type;
 		typedef tvec3<bool, P> bool_type;
 		typedef T value_type;
 		typedef T value_type;
-		typedef int size_type;
-
-		//////////////////////////////////////
-		// Helper
-
-#		ifdef 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;
-#		endif//GLM_FORCE_SIZE_FUNC
 
 
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Data
 		// Data
@@ -100,10 +88,23 @@ namespace glm
 #		endif//GLM_LANG
 #		endif//GLM_LANG
 
 
 		//////////////////////////////////////
 		//////////////////////////////////////
-		// Accesses
+		// Component accesses
 
 
-		GLM_FUNC_DECL T & operator[](length_t i);
-		GLM_FUNC_DECL T const & operator[](length_t i) const;
+#		ifdef GLM_FORCE_SIZE_FUNC
+			/// Return the count of components of the vector
+			typedef size_t size_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const;
+
+			GLM_FUNC_DECL T & operator[](size_type i);
+			GLM_FUNC_DECL T const & operator[](size_type i) const;
+#		else
+			/// Return the count of components of the vector
+			typedef length_t length_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
+
+			GLM_FUNC_DECL T & operator[](length_type i);
+			GLM_FUNC_DECL T const & operator[](length_type i) const;
+#		endif//GLM_FORCE_SIZE_FUNC
 
 
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Implicit basic constructors
 		// Implicit basic constructors

+ 45 - 31
glm/detail/type_vec3.inl

@@ -32,37 +32,6 @@
 
 
 namespace glm
 namespace glm
 {
 {
-#ifdef 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>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tvec3<T, P>::length() const
-	{
-		return 3;
-	}
-#endif
-
-	//////////////////////////////////////
-	// Accesses
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER T & tvec3<T, P>::operator[](length_t i)
-	{
-		assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
-		return (&x)[i];
-	}
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER T const & tvec3<T, P>::operator[](length_t i) const
-	{
-		assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
-		return (&x)[i];
-	}
-
 	//////////////////////////////////////
 	//////////////////////////////////////
 	// Implicit basic constructors
 	// Implicit basic constructors
 
 
@@ -166,6 +135,51 @@ namespace glm
 		z(static_cast<T>(v.z))
 		z(static_cast<T>(v.z))
 	{}
 	{}
 
 
+	//////////////////////////////////////
+	// Component accesses
+
+#	ifdef GLM_FORCE_SIZE_FUNC
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec3<T, P>::size_type tvec3<T, P>::size() const
+		{
+			return 3;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER T & tvec3<T, P>::operator[](typename tvec3<T, P>::size_type i)
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&x)[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER T const & tvec3<T, P>::operator[](typename tvec3<T, P>::size_type i) const
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&x)[i];
+		}
+#	else
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec3<T, P>::length_type tvec3<T, P>::length() const
+		{
+			return 3;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER T & tvec3<T, P>::operator[](typename tvec3<T, P>::length_type i)
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&x)[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER T const & tvec3<T, P>::operator[](typename tvec3<T, P>::length_type i) const
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&x)[i];
+		}
+#	endif//GLM_FORCE_SIZE_FUNC
+
 	//////////////////////////////////////
 	//////////////////////////////////////
 	// Unary arithmetic operators
 	// Unary arithmetic operators
 
 

+ 16 - 15
glm/detail/type_vec4.hpp

@@ -106,18 +106,6 @@ namespace detail
 		typedef tvec4<T, P> type;
 		typedef tvec4<T, P> type;
 		typedef tvec4<bool, P> bool_type;
 		typedef tvec4<bool, P> bool_type;
 		typedef T value_type;
 		typedef T value_type;
-		typedef int size_type;
-
-		//////////////////////////////////////
-		// Helper
-
-#		ifdef 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;
-#		endif//GLM_FORCE_SIZE_FUNC
 
 
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Data
 		// Data
@@ -154,10 +142,23 @@ namespace detail
 #		endif//GLM_LANG
 #		endif//GLM_LANG
 
 
 		//////////////////////////////////////
 		//////////////////////////////////////
-		// Accesses
+		// Component accesses
 
 
-		GLM_FUNC_DECL T & operator[](length_t i);
-		GLM_FUNC_DECL T const & operator[](length_t i) const;
+#		ifdef GLM_FORCE_SIZE_FUNC
+			/// Return the count of components of the vector
+			typedef size_t size_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const;
+
+			GLM_FUNC_DECL T & operator[](size_type i);
+			GLM_FUNC_DECL T const & operator[](size_type i) const;
+#		else
+			/// Return the count of components of the vector
+			typedef length_t length_type;
+			GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
+
+			GLM_FUNC_DECL T & operator[](length_type i);
+			GLM_FUNC_DECL T const & operator[](length_type i) const;
+#		endif//GLM_FORCE_SIZE_FUNC
 
 
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Implicit basic constructors
 		// Implicit basic constructors

+ 45 - 31
glm/detail/type_vec4.inl

@@ -32,37 +32,6 @@
 
 
 namespace glm
 namespace glm
 {
 {
-#ifdef 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>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tvec4<T, P>::length() const
-	{
-		return 4;
-	}
-#endif
-
-	//////////////////////////////////////
-	// Accesses
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER T & tvec4<T, P>::operator[](length_t i)
-	{
-		assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
-		return (&x)[i];
-	}
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER T const & tvec4<T, P>::operator[](length_t i) const
-	{
-		assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
-		return (&x)[i];
-	}
-
 	//////////////////////////////////////
 	//////////////////////////////////////
 	// Implicit basic constructors
 	// Implicit basic constructors
 
 
@@ -268,6 +237,51 @@ namespace glm
 		w(static_cast<T>(v.w))
 		w(static_cast<T>(v.w))
 	{}
 	{}
 
 
+	//////////////////////////////////////
+	// Component accesses
+
+#	ifdef GLM_FORCE_SIZE_FUNC
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec4<T, P>::size_type tvec4<T, P>::size() const
+		{
+			return 4;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER T & tvec4<T, P>::operator[](typename tvec4<T, P>::size_type i)
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&x)[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER T const & tvec4<T, P>::operator[](typename tvec4<T, P>::size_type i) const
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&x)[i];
+		}
+#	else
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec4<T, P>::length_type tvec4<T, P>::length() const
+		{
+			return 4;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER T & tvec4<T, P>::operator[](typename tvec4<T, P>::length_type i)
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&x)[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER T const & tvec4<T, P>::operator[](typename tvec4<T, P>::length_type i) const
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&x)[i];
+		}
+#	endif//GLM_FORCE_SIZE_FUNC
+
 	//////////////////////////////////////
 	//////////////////////////////////////
 	// Unary arithmetic operators
 	// Unary arithmetic operators
 
 

+ 17 - 12
glm/gtc/quaternion.hpp

@@ -62,25 +62,30 @@ namespace glm
 	template <typename T, precision P>
 	template <typename T, precision P>
 	struct tquat
 	struct tquat
 	{
 	{
+		typedef tquat<T, P> type;
 		typedef T value_type;
 		typedef T value_type;
-		typedef tvec4<bool, P> bool_type;
 
 
 	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;
-#endif//GLM_FORCE_SIZE_FUNC
-
 		//////////////////////////////////////
 		//////////////////////////////////////
-		// Accesses
+		// Component accesses
+
+#		ifdef GLM_FORCE_SIZE_FUNC
+			typedef size_t size_type;
+			/// Return the count of components of a quaternion
+			GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const;
+
+			GLM_FUNC_DECL T & operator[](size_type i);
+			GLM_FUNC_DECL T const & operator[](size_type i) const;
+#		else
+			typedef length_t length_type;
+			/// Return the count of components of a quaternion
+			GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
 
 
-		GLM_FUNC_DECL T & operator[](length_t i);
-		GLM_FUNC_DECL T const & operator[](length_t i) const;
+			GLM_FUNC_DECL T & operator[](length_type i);
+			GLM_FUNC_DECL T const & operator[](length_type i) const;
+#		endif//GLM_FORCE_SIZE_FUNC
 
 
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Implicit basic constructors
 		// Implicit basic constructors

+ 42 - 28
glm/gtc/quaternion.inl

@@ -49,43 +49,57 @@ 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>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tquat<T, P>::length() const
-	{
-		return 4;
-	}
-#endif
-
 	//////////////////////////////////////
 	//////////////////////////////////////
-	// Accesses
+	// Component accesses
 
 
-	template <typename T, precision P> 
-	GLM_FUNC_QUALIFIER T & tquat<T, P>::operator[] (length_t i)
-	{
-		assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
-		return (&x)[i];
-	}
+#	ifdef GLM_FORCE_SIZE_FUNC
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tquat<T, P>::size_type tquat<T, P>::size() const
+		{
+			return 4;
+		}
 
 
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER T const & tquat<T, P>::operator[] (length_t i) const
-	{
-		assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
-		return (&x)[i];
-	}
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER T & tquat<T, P>::operator[](typename tquat<T, P>::size_type i)
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&x)[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER T const & tquat<T, P>::operator[](typename tquat<T, P>::size_type i) const
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&x)[i];
+		}
+#	else
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tquat<T, P>::length_type tquat<T, P>::length() const
+		{
+			return 4;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER T & tquat<T, P>::operator[](typename tquat<T, P>::length_type i)
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&x)[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER T const & tquat<T, P>::operator[](typename tquat<T, P>::length_type i) const
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&x)[i];
+		}
+#	endif//GLM_FORCE_SIZE_FUNC
 
 
 	//////////////////////////////////////
 	//////////////////////////////////////
 	// Implicit basic constructors
 	// Implicit basic constructors
 
 
 	template <typename T, precision P>
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER tquat<T, P>::tquat()
 	GLM_FUNC_QUALIFIER tquat<T, P>::tquat()
-#		ifndef GLM_FORCE_NO_CTOR_INIT 
+#		ifndef GLM_FORCE_NO_CTOR_INIT
 			: x(0), y(0), z(0), w(1)
 			: x(0), y(0), z(0), w(1)
 #		endif
 #		endif
 	{}
 	{}

+ 19 - 12
glm/gtx/dual_quaternion.hpp

@@ -67,14 +67,25 @@ 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;
-#endif//GLM_FORCE_SIZE_FUNC
-		
+		//////////////////////////////////////
+		// Component accesses
+
+#		ifdef GLM_FORCE_SIZE_FUNC
+			typedef size_t size_type;
+			/// Return the count of components of a dual quaternion
+			GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const;
+
+			GLM_FUNC_DECL part_type & operator[](size_type i);
+			GLM_FUNC_DECL part_type const & operator[](size_type i) const;
+#		else
+			typedef length_t length_type;
+			/// Return the count of components of a dual quaternion
+			GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
+
+			GLM_FUNC_DECL part_type & operator[](length_type i);
+			GLM_FUNC_DECL part_type const & operator[](length_type i) const;
+#		endif//GLM_FORCE_SIZE_FUNC
+
 		//////////////////////////////////////
 		//////////////////////////////////////
 		// Implicit basic constructors
 		// Implicit basic constructors
 
 
@@ -104,10 +115,6 @@ namespace glm
 		GLM_FUNC_DECL explicit tdualquat(tmat2x4<T, P> const & holder_mat);
 		GLM_FUNC_DECL explicit tdualquat(tmat2x4<T, P> const & holder_mat);
 		GLM_FUNC_DECL explicit tdualquat(tmat3x4<T, P> const & aug_mat);
 		GLM_FUNC_DECL explicit tdualquat(tmat3x4<T, P> const & aug_mat);
 		
 		
-		// Accesses
-		GLM_FUNC_DECL part_type & operator[](int i);
-		GLM_FUNC_DECL part_type const & operator[](int i) const;
-		
 		// Operators
 		// Operators
 		GLM_FUNC_DECL tdualquat<T, P> & operator*=(T const & s);
 		GLM_FUNC_DECL tdualquat<T, P> & operator*=(T const & s);
 		GLM_FUNC_DECL tdualquat<T, P> & operator/=(T const & s);
 		GLM_FUNC_DECL tdualquat<T, P> & operator/=(T const & s);

+ 48 - 31
glm/gtx/dual_quaternion.inl

@@ -35,19 +35,53 @@
 
 
 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 2;
-	}
-#else
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tdualquat<T, P>::length() const
-	{
-		return 2;
-	}
-#endif
+	//////////////////////////////////////
+	// Component accesses
+
+#	ifdef GLM_FORCE_SIZE_FUNC
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tdualquat<T, P>::size_type tdualquat<T, P>::size() const
+		{
+			return 2;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tdualquat<T, P>::part_type & tdualquat<T, P>::operator[](typename tdualquat<T, P>::size_type i)
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&real)[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tdualquat<T, P>::part_type const & tdualquat<T, P>::operator[](typename tdualquat<T, P>::size_type i) const
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&real)[i];
+		}
+#	else
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tdualquat<T, P>::length_type tdualquat<T, P>::length() const
+		{
+			return 2;
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tdualquat<T, P>::part_type & tdualquat<T, P>::operator[](typename tdualquat<T, P>::length_type i)
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&real)[i];
+		}
+
+		template <typename T, precision P>
+		GLM_FUNC_QUALIFIER typename tdualquat<T, P>::part_type const & tdualquat<T, P>::operator[](typename tdualquat<T, P>::length_type i) const
+		{
+			assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
+			return (&real)[i];
+		}
+#	endif//GLM_FORCE_SIZE_FUNC
+
+	//////////////////////////////////////
+	// Implicit basic constructors
 
 
 	template <typename T, precision P>
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat()
 	GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat()
@@ -113,24 +147,7 @@ namespace glm
 	}
 	}
 
 
 	//////////////////////////////////////////////////////////////
 	//////////////////////////////////////////////////////////////
-	// tdualquat<T, P> accesses
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER typename tdualquat<T, P>::part_type & tdualquat<T, P>::operator[](length_t i)
-	{
-		assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
-		return (&real)[i];
-	}
-
-	template <typename T, precision P>
-	GLM_FUNC_QUALIFIER typename tdualquat<T, P>::part_type const & tdualquat<T, P>::operator[](length_t i) const
-	{
-		assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
-		return (&real)[i];
-	}
-
-	//////////////////////////////////////////////////////////////
-	// tdualquat<valType> operators
+	// tdualquat operators
 
 
 	template <typename T, precision P>
 	template <typename T, precision P>
 	GLM_FUNC_QUALIFIER tdualquat<T, P> & tdualquat<T, P>::operator*=(T const & s)
 	GLM_FUNC_QUALIFIER tdualquat<T, P> & tdualquat<T, P>::operator*=(T const & s)