Browse Source

Merge branch '0.9.2' into 0.9.3

Christophe Riccio 14 years ago
parent
commit
823aeb290e
5 changed files with 4165 additions and 4189 deletions
  1. 0 20
      glm/core/_swizzle.inl
  2. 871 872
      glm/core/type_vec1.inl
  3. 997 998
      glm/core/type_vec2.inl
  4. 1084 1085
      glm/core/type_vec3.inl
  5. 1213 1214
      glm/core/type_vec4.inl

+ 0 - 20
glm/core/_swizzle.inl

@@ -1,20 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Created : 2006-04-27
-// Updated : 2006-04-27
-// Licence : This source is under MIT License
-// File    : _swizzle.inl
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-#ifndef __swizzle_inl__
-#define __swizzle_inl__
-
-#include "./_swizzle.h"
-
-namespace glm
-{
-
-}
-
-#endif//__swizzle_inl__

+ 871 - 872
glm/core/type_vec1.inl

@@ -7,879 +7,878 @@
 // File    : glm/core/type_vec1.inl
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-namespace glm
+namespace glm{
+namespace detail
 {
-	namespace detail
-	{
-		template <typename T>
-		GLM_FUNC_QUALIFIER typename tvec1<T>::size_type tvec1<T>::length() const
-		{
-			return 1;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER typename tvec1<T>::size_type tvec1<T>::value_size()
-		{
-			return 1;
-		}
-
-		//////////////////////////////////////
-		// Accesses
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER typename tvec1<T>::value_type & tvec1<T>::operator[]
-		(
-			size_type i
-		)
-		{
-			assert(i < value_size());
-			return (&x)[i];
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER typename tvec1<T>::value_type const & tvec1<T>::operator[]
-		(
-			size_type i
-		) const
-		{
-			assert(i < value_size());
-			return (&x)[i];
-		}
-
-		//////////////////////////////////////
-		// Implicit basic constructors
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T>::tvec1() :
-			x(value_type(0))
-		{}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T>::tvec1
-		(
-			ctor
-		)
-		{}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T>::tvec1
-		(
-			tvec1<T> const & v
-		) :
-			x(v.x)
-		{}
-
-		//////////////////////////////////////
-		// Explicit basic constructors
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T>::tvec1
-		(
-			value_type const & s
-		) :
-			x(s)
-		{}
-
-		//////////////////////////////////////
-		// Swizzle constructors
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T>::tvec1
-		(
-			tref1<T> const & r
-		) :
-			x(r.x)
-		{}
-
-		//////////////////////////////////////
-		// Convertion scalar constructors
+	template <typename T>
+	GLM_FUNC_QUALIFIER typename tvec1<T>::size_type tvec1<T>::length() const
+	{
+		return 1;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER typename tvec1<T>::size_type tvec1<T>::value_size()
+	{
+		return 1;
+	}
+
+	//////////////////////////////////////
+	// Accesses
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER typename tvec1<T>::value_type & tvec1<T>::operator[]
+	(
+		size_type i
+	)
+	{
+		assert(i < value_size());
+		return (&x)[i];
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER typename tvec1<T>::value_type const & tvec1<T>::operator[]
+	(
+		size_type i
+	) const
+	{
+		assert(i < value_size());
+		return (&x)[i];
+	}
+
+	//////////////////////////////////////
+	// Implicit basic constructors
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T>::tvec1() :
+		x(value_type(0))
+	{}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T>::tvec1
+	(
+		ctor
+	)
+	{}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T>::tvec1
+	(
+		tvec1<T> const & v
+	) :
+		x(v.x)
+	{}
+
+	//////////////////////////////////////
+	// Explicit basic constructors
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T>::tvec1
+	(
+		value_type const & s
+	) :
+		x(s)
+	{}
+
+	//////////////////////////////////////
+	// Swizzle constructors
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T>::tvec1
+	(
+		tref1<T> const & r
+	) :
+		x(r.x)
+	{}
+
+	//////////////////////////////////////
+	// Convertion scalar constructors
 		
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec1<T>::tvec1
-		(
-			U const & s
-		) :
-			x(value_type(s))
-		{}
-
-		//////////////////////////////////////
-		// Convertion vector constructors
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec1<T>::tvec1
-		(
-			tvec2<U> const & v
-		) :
-			x(value_type(v.x))
-		{}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec1<T>::tvec1
-		(
-			tvec3<U> const & v
-		) :
-			x(value_type(v.x))
-		{}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec1<T>::tvec1
-		(
-			tvec4<U> const & v
-		) :
-			x(value_type(v.x))
-		{}
-
-		//////////////////////////////////////
-		// Unary arithmetic operators
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator=
-		(
-			tvec1<T> const & v
-		)
-		{
-			this->x = v.x;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator+=
-		(
-			value_type const & s
-		)
-		{
-			this->x += s;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator+=
-		(
-			tvec1<T> const & v
-		)
-		{
-			this->x += v.x;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator-=
-		(
-			value_type const & s
-		)
-		{
-			this->x -= s;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator-=
-		(
-			tvec1<T> const & v
-		)
-		{
-			this->x -= v.x;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator*=
-		(
-			value_type const & s
-		)
-		{
-			this->x *= s;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator*=
-		(	
-			tvec1<T> const & v
-		)
-		{
-			this->x *= v.x;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator/=
-		(
-			value_type const & s
-		)
-		{
-			this->x /= s;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator/=
-		(
-			tvec1<T> const & v
-		)
-		{
-			this->x /= v.x;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator++()
-		{
-			++this->x;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator--()
-		{
-			--this->x;
-			return *this;
-		}
-
-		//////////////////////////////////////
-		// Boolean operators
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER bool operator==
-		(
-			tvec1<T> const & v1, 
-			tvec1<T> const & v2
-		)
-		{
-			return (v1.x == v2.x);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER bool operator!=
-		(
-			tvec1<T> const & v1, 
-			tvec1<T> const & v2
-		)
-		{
-			return (v1.x != v2.x);
-		}
-
-		//////////////////////////////////////
-		// Unary bit operators
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator%=
-		(
-			value_type const & s
-		)
-		{
-			this->x %= s;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator%=
-		(
-			tvec1<T> const & v
-		)
-		{
-			this->x %= v.x;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator&=
-		(
-			value_type const & s
-		)
-		{
-			this->x &= s;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator&=
-		(
-			tvec1<T> const & v
-		)
-		{
-			this->x &= v.x;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator|=
-		(
-			value_type const & s
-		)
-		{
-			this->x |= s;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator|=
-		(
-			tvec1<T> const & v
-		)
-		{
-			this->x |= v.x;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator^=
-		(
-			value_type const & s
-		)
-		{
-			this->x ^= s;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator^=
-		(
-			tvec1<T> const & v
-		)
-		{
-			this->x ^= v.x;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator<<=
-		(
-			value_type const & s
-		)
-		{
-			this->x <<= s;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator<<=
-		(
-			tvec1<T> const & v
-		)
-		{
-			this->x <<= v.x;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator>>=
-		(
-			value_type const & s
-		)
-		{
-			this->x >>= s;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator>>=
-		(
-			tvec1<T> const & v
-		)
-		{
-			this->x >>= v.x;
-			return *this;
-		}
-
-		//////////////////////////////////////
-		// Swizzle operators
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER T 
-		tvec1<T>::swizzle(comp x) const
-		{
-			return (*this)[x];
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> 
-		tvec1<T>::swizzle
-		(
-			comp x, 
-			comp y
-		) const
-		{
-			return tvec2<T>(
-				(*this)[x],
-				(*this)[y]);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> 
-		tvec1<T>::swizzle
-		(
-			comp x, 
-			comp y, 
-			comp z
-		) const
-		{
-			return tvec3<T>(
-				(*this)[x],
-				(*this)[y],
-				(*this)[z]);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> 
-		tvec1<T>::swizzle
-		(
-			comp x, 
-			comp y, 
-			comp z, 
-			comp w
-		) const
-		{
-			return tvec4<T>(
-				(*this)[x],
-				(*this)[y],
-				(*this)[z],
-				(*this)[w]);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tref1<T> 
-		tvec1<T>::swizzle
-		(
-			comp x
-		)
-		{
-			return tref1<T>(
-				(*this)[x]);
-		}
-
-		//////////////////////////////////////
-		// Binary arithmetic operators
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec1<T> operator+ 
-		(
-			tvec1<T> const & v, 
-			typename tvec1<T>::value_type const & s
-		)
-		{
-			return tvec1<T>(
-				v.x + s);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec1<T> operator+ 
-		(
-			typename tvec1<T>::value_type const & s, 
-			tvec1<T> const & v
-		)
-		{
-			return tvec1<T>(
-				s + v.x);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec1<T> operator+ 
-		(
-			tvec1<T> const & v1, 
-			tvec1<T> const & v2
-		)
-		{
-			return tvec1<T>(
-				v1.x + v2.x);
-		}
-
-		//operator-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec1<T> operator- 
-		(
-			tvec1<T> const & v, 
-			typename tvec1<T>::value_type const & s
-		)
-		{
-			return tvec1<T>(
-				v.x - s);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec1<T> operator- 
-		(
-			typename tvec1<T>::value_type const & s, 
-			tvec1<T> const & v
-		)
-		{
-			return tvec1<T>(
-				s - v.x);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec1<T> operator- 
-		(
-			tvec1<T> const & v1, 
-			tvec1<T> const & v2
-		)
-		{
-			return tvec1<T>(
-				v1.x - v2.x);
-		}
-
-		//operator*
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec1<T> operator* 
-		(
-			tvec1<T> const & v, 
-			typename tvec1<T>::value_type const & s
-		)
-		{
-			return tvec1<T>(
-				v.x * s);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec1<T> operator* 
-		(
-			typename tvec1<T>::value_type const & s, 
-			tvec1<T> const & v
-		)
-		{
-			return tvec1<T>(
-				s * v.x);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec1<T> operator*
-		(
-			tvec1<T> const & v1, 
-			tvec1<T> const & v2
-		)
-		{
-			return tvec1<T>(
-				v1.x * v2.x);
-		}
-
-		//operator/
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec1<T> operator/ 
-		(
-			tvec1<T> const & v, 
-			typename tvec1<T>::value_type const & s
-		)
-		{
-			return tvec1<T>(
-				v.x / s);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec1<T> operator/ 
-		(
-			typename tvec1<T>::value_type const & s, 
-			tvec1<T> const & v
-		)
-		{
-			return tvec1<T>(
-				s / v.x);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec1<T> operator/ 
-		(
-			tvec1<T> const & v1, 
-			tvec1<T> const & v2
-		)
-		{
-			return tvec1<T>(
-				v1.x / v2.x);
-		}
-
-		// Unary constant operators
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec1<T> operator- 
-		(
-			tvec1<T> const & v
-		)
-		{
-			return tvec1<T>(
-				-v.x);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec1<T> operator++ 
-		(
-			tvec1<T> const & v, 
-			int
-		)
-		{
-			return tvec1<T>(
-				v.x + T(1));
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec1<T> operator-- 
-		(
-			tvec1<T> const & v, 
-			int
-		)
-		{
-			return tvec1<T>(
-				v.x - T(1));
-		}
-
-		//////////////////////////////////////
-		// Binary bit operators
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> operator% 
-		(
-			tvec1<T> const & v, 
-			typename tvec1<T>::value_type const & s
-		)
-		{
-			return tvec1<T>(
-				v.x % s);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> operator% 
-		(
-			typename tvec1<T>::value_type const & s, 
-			tvec1<T> const & v
-		)
-		{
-			return tvec1<T>(
-				s % v.x);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> operator% 
-		(
-			tvec1<T> const & v1, 
-			tvec1<T> const & v2
-		)
-		{
-			return tvec1<T>(
-				v1.x % v2.x);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> operator& 
-		(
-			tvec1<T> const & v, 
-			typename tvec1<T>::value_type const & s
-		)
-		{
-			return tvec1<T>(
-				v.x & s);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> operator& 
-		(
-			typename tvec1<T>::value_type const & s, 
-			tvec1<T> const & v
-		)
-		{
-			return tvec1<T>(
-				s & v.x);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> operator& 
-		(
-			tvec1<T> const & v1, 
-			tvec1<T> const & v2
-		)
-		{
-			return tvec1<T>(
-				v1.x & v2.x);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> operator| 
-		(
-			tvec1<T> const & v, 
-			typename tvec1<T>::value_type const & s
-		)
-		{
-			return tvec1<T>(
-				v.x | s);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> operator| 
-		(
-			typename tvec1<T>::value_type const & s, 
-			tvec1<T> const & v
-		)
-		{
-			return tvec1<T>(
-				s | v.x);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> operator| 
-		(
-			tvec1<T> const & v1, 
-			tvec1<T> const & v2
-		)
-		{
-			return tvec1<T>(
-				v1.x | v2.x);
-		}
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec1<T>::tvec1
+	(
+		U const & s
+	) :
+		x(value_type(s))
+	{}
+
+	//////////////////////////////////////
+	// Convertion vector constructors
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec1<T>::tvec1
+	(
+		tvec2<U> const & v
+	) :
+		x(value_type(v.x))
+	{}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec1<T>::tvec1
+	(
+		tvec3<U> const & v
+	) :
+		x(value_type(v.x))
+	{}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec1<T>::tvec1
+	(
+		tvec4<U> const & v
+	) :
+		x(value_type(v.x))
+	{}
+
+	//////////////////////////////////////
+	// Unary arithmetic operators
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator=
+	(
+		tvec1<T> const & v
+	)
+	{
+		this->x = v.x;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator+=
+	(
+		value_type const & s
+	)
+	{
+		this->x += s;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator+=
+	(
+		tvec1<T> const & v
+	)
+	{
+		this->x += v.x;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator-=
+	(
+		value_type const & s
+	)
+	{
+		this->x -= s;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator-=
+	(
+		tvec1<T> const & v
+	)
+	{
+		this->x -= v.x;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator*=
+	(
+		value_type const & s
+	)
+	{
+		this->x *= s;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator*=
+	(	
+		tvec1<T> const & v
+	)
+	{
+		this->x *= v.x;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator/=
+	(
+		value_type const & s
+	)
+	{
+		this->x /= s;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator/=
+	(
+		tvec1<T> const & v
+	)
+	{
+		this->x /= v.x;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator++()
+	{
+		++this->x;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator--()
+	{
+		--this->x;
+		return *this;
+	}
+
+	//////////////////////////////////////
+	// Boolean operators
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER bool operator==
+	(
+		tvec1<T> const & v1, 
+		tvec1<T> const & v2
+	)
+	{
+		return (v1.x == v2.x);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER bool operator!=
+	(
+		tvec1<T> const & v1, 
+		tvec1<T> const & v2
+	)
+	{
+		return (v1.x != v2.x);
+	}
+
+	//////////////////////////////////////
+	// Unary bit operators
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator%=
+	(
+		value_type const & s
+	)
+	{
+		this->x %= s;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator%=
+	(
+		tvec1<T> const & v
+	)
+	{
+		this->x %= v.x;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator&=
+	(
+		value_type const & s
+	)
+	{
+		this->x &= s;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator&=
+	(
+		tvec1<T> const & v
+	)
+	{
+		this->x &= v.x;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator|=
+	(
+		value_type const & s
+	)
+	{
+		this->x |= s;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator|=
+	(
+		tvec1<T> const & v
+	)
+	{
+		this->x |= v.x;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator^=
+	(
+		value_type const & s
+	)
+	{
+		this->x ^= s;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator^=
+	(
+		tvec1<T> const & v
+	)
+	{
+		this->x ^= v.x;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator<<=
+	(
+		value_type const & s
+	)
+	{
+		this->x <<= s;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator<<=
+	(
+		tvec1<T> const & v
+	)
+	{
+		this->x <<= v.x;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator>>=
+	(
+		value_type const & s
+	)
+	{
+		this->x >>= s;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> & tvec1<T>::operator>>=
+	(
+		tvec1<T> const & v
+	)
+	{
+		this->x >>= v.x;
+		return *this;
+	}
+
+	//////////////////////////////////////
+	// Swizzle operators
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER T 
+	tvec1<T>::swizzle(comp x) const
+	{
+		return (*this)[x];
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> 
+	tvec1<T>::swizzle
+	(
+		comp x, 
+		comp y
+	) const
+	{
+		return tvec2<T>(
+			(*this)[x],
+			(*this)[y]);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> 
+	tvec1<T>::swizzle
+	(
+		comp x, 
+		comp y, 
+		comp z
+	) const
+	{
+		return tvec3<T>(
+			(*this)[x],
+			(*this)[y],
+			(*this)[z]);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> 
+	tvec1<T>::swizzle
+	(
+		comp x, 
+		comp y, 
+		comp z, 
+		comp w
+	) const
+	{
+		return tvec4<T>(
+			(*this)[x],
+			(*this)[y],
+			(*this)[z],
+			(*this)[w]);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tref1<T> 
+	tvec1<T>::swizzle
+	(
+		comp x
+	)
+	{
+		return tref1<T>(
+			(*this)[x]);
+	}
+
+	//////////////////////////////////////
+	// Binary arithmetic operators
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec1<T> operator+ 
+	(
+		tvec1<T> const & v, 
+		typename tvec1<T>::value_type const & s
+	)
+	{
+		return tvec1<T>(
+			v.x + s);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec1<T> operator+ 
+	(
+		typename tvec1<T>::value_type const & s, 
+		tvec1<T> const & v
+	)
+	{
+		return tvec1<T>(
+			s + v.x);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec1<T> operator+ 
+	(
+		tvec1<T> const & v1, 
+		tvec1<T> const & v2
+	)
+	{
+		return tvec1<T>(
+			v1.x + v2.x);
+	}
+
+	//operator-
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec1<T> operator- 
+	(
+		tvec1<T> const & v, 
+		typename tvec1<T>::value_type const & s
+	)
+	{
+		return tvec1<T>(
+			v.x - s);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec1<T> operator- 
+	(
+		typename tvec1<T>::value_type const & s, 
+		tvec1<T> const & v
+	)
+	{
+		return tvec1<T>(
+			s - v.x);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec1<T> operator- 
+	(
+		tvec1<T> const & v1, 
+		tvec1<T> const & v2
+	)
+	{
+		return tvec1<T>(
+			v1.x - v2.x);
+	}
+
+	//operator*
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec1<T> operator* 
+	(
+		tvec1<T> const & v, 
+		typename tvec1<T>::value_type const & s
+	)
+	{
+		return tvec1<T>(
+			v.x * s);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec1<T> operator* 
+	(
+		typename tvec1<T>::value_type const & s, 
+		tvec1<T> const & v
+	)
+	{
+		return tvec1<T>(
+			s * v.x);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec1<T> operator*
+	(
+		tvec1<T> const & v1, 
+		tvec1<T> const & v2
+	)
+	{
+		return tvec1<T>(
+			v1.x * v2.x);
+	}
+
+	//operator/
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec1<T> operator/ 
+	(
+		tvec1<T> const & v, 
+		typename tvec1<T>::value_type const & s
+	)
+	{
+		return tvec1<T>(
+			v.x / s);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec1<T> operator/ 
+	(
+		typename tvec1<T>::value_type const & s, 
+		tvec1<T> const & v
+	)
+	{
+		return tvec1<T>(
+			s / v.x);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec1<T> operator/ 
+	(
+		tvec1<T> const & v1, 
+		tvec1<T> const & v2
+	)
+	{
+		return tvec1<T>(
+			v1.x / v2.x);
+	}
+
+	// Unary constant operators
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec1<T> operator- 
+	(
+		tvec1<T> const & v
+	)
+	{
+		return tvec1<T>(
+			-v.x);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec1<T> operator++ 
+	(
+		tvec1<T> const & v, 
+		int
+	)
+	{
+		return tvec1<T>(
+			v.x + T(1));
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec1<T> operator-- 
+	(
+		tvec1<T> const & v, 
+		int
+	)
+	{
+		return tvec1<T>(
+			v.x - T(1));
+	}
+
+	//////////////////////////////////////
+	// Binary bit operators
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> operator% 
+	(
+		tvec1<T> const & v, 
+		typename tvec1<T>::value_type const & s
+	)
+	{
+		return tvec1<T>(
+			v.x % s);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> operator% 
+	(
+		typename tvec1<T>::value_type const & s, 
+		tvec1<T> const & v
+	)
+	{
+		return tvec1<T>(
+			s % v.x);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> operator% 
+	(
+		tvec1<T> const & v1, 
+		tvec1<T> const & v2
+	)
+	{
+		return tvec1<T>(
+			v1.x % v2.x);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> operator& 
+	(
+		tvec1<T> const & v, 
+		typename tvec1<T>::value_type const & s
+	)
+	{
+		return tvec1<T>(
+			v.x & s);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> operator& 
+	(
+		typename tvec1<T>::value_type const & s, 
+		tvec1<T> const & v
+	)
+	{
+		return tvec1<T>(
+			s & v.x);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> operator& 
+	(
+		tvec1<T> const & v1, 
+		tvec1<T> const & v2
+	)
+	{
+		return tvec1<T>(
+			v1.x & v2.x);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> operator| 
+	(
+		tvec1<T> const & v, 
+		typename tvec1<T>::value_type const & s
+	)
+	{
+		return tvec1<T>(
+			v.x | s);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> operator| 
+	(
+		typename tvec1<T>::value_type const & s, 
+		tvec1<T> const & v
+	)
+	{
+		return tvec1<T>(
+			s | v.x);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> operator| 
+	(
+		tvec1<T> const & v1, 
+		tvec1<T> const & v2
+	)
+	{
+		return tvec1<T>(
+			v1.x | v2.x);
+	}
 		
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> operator^ 
-		(
-			tvec1<T> const & v, 
-			typename tvec1<T>::value_type const & s
-		)
-		{
-			return tvec1<T>(
-				v.x ^ s);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> operator^ 
-		(
-			typename tvec1<T>::value_type const & s, 
-			tvec1<T> const & v
-		)
-		{
-			return tvec1<T>(
-				s ^ v.x);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> operator^ 
-		(
-			tvec1<T> const & v1, 
-			tvec1<T> const & v2
-		)
-		{
-			return tvec1<T>(
-				v1.x ^ v2.x);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> operator<< 
-		(
-			tvec1<T> const & v, 
-			typename tvec1<T>::value_type const & s
-		)
-		{
-			return tvec1<T>(
-				v.x << s);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> operator<< 
-		(
-			typename tvec1<T>::value_type const & s, 
-			tvec1<T> const & v
-		)
-		{
-			return tvec1<T>(
-				s << v.x);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> operator<< 
-		(
-			tvec1<T> const & v1, 
-			tvec1<T> const & v2
-		)
-		{
-			return tvec1<T>(
-				v1.x << v2.x);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> operator>> 
-		(
-			tvec1<T> const & v, 
-			typename tvec1<T>::value_type const & s
-		)
-		{
-			return tvec1<T>(
-				v.x >> s);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> operator>> 
-		(
-			typename tvec1<T>::value_type const & s, 
-			tvec1<T> const & v
-		)
-		{
-			return tvec1<T>(
-				s >> v.x);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec1<T> operator>> 
-		(
-			tvec1<T> const & v1, 
-			tvec1<T> const & v2
-		)
-		{
-			return tvec1<T>(
-				v1.x >> v2.x);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec1<T> operator~ 
-		(
-			tvec1<T> const & v
-		)
-		{
-			return tvec1<T>(
-				~v.x);
-		}
-
-		//////////////////////////////////////
-		// tref definition
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tref1<T>::tref1
-		(
-			T & x
-		) :
-			x(x)
-		{}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tref1<T>::tref1
-		(
-			tref1<T> const & r
-		) :
-			x(r.x)
-		{}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tref1<T>::tref1
-		(
-			tvec1<T> const & v
-		) :
-			x(v.x)
-		{}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tref1<T> & tref1<T>::operator= 
-		(
-			tref1<T> const & r
-		)
-		{
-			x = r.x;
-			return *this;
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tref1<T> & tref1<T>::operator= 
-		(
-			tvec1<T> const & v
-		)
-		{
-			x = v.x;
-			return *this;
-		}
-
-	}//namespace detail
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> operator^ 
+	(
+		tvec1<T> const & v, 
+		typename tvec1<T>::value_type const & s
+	)
+	{
+		return tvec1<T>(
+			v.x ^ s);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> operator^ 
+	(
+		typename tvec1<T>::value_type const & s, 
+		tvec1<T> const & v
+	)
+	{
+		return tvec1<T>(
+			s ^ v.x);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> operator^ 
+	(
+		tvec1<T> const & v1, 
+		tvec1<T> const & v2
+	)
+	{
+		return tvec1<T>(
+			v1.x ^ v2.x);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> operator<< 
+	(
+		tvec1<T> const & v, 
+		typename tvec1<T>::value_type const & s
+	)
+	{
+		return tvec1<T>(
+			v.x << s);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> operator<< 
+	(
+		typename tvec1<T>::value_type const & s, 
+		tvec1<T> const & v
+	)
+	{
+		return tvec1<T>(
+			s << v.x);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> operator<< 
+	(
+		tvec1<T> const & v1, 
+		tvec1<T> const & v2
+	)
+	{
+		return tvec1<T>(
+			v1.x << v2.x);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> operator>> 
+	(
+		tvec1<T> const & v, 
+		typename tvec1<T>::value_type const & s
+	)
+	{
+		return tvec1<T>(
+			v.x >> s);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> operator>> 
+	(
+		typename tvec1<T>::value_type const & s, 
+		tvec1<T> const & v
+	)
+	{
+		return tvec1<T>(
+			s >> v.x);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec1<T> operator>> 
+	(
+		tvec1<T> const & v1, 
+		tvec1<T> const & v2
+	)
+	{
+		return tvec1<T>(
+			v1.x >> v2.x);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec1<T> operator~ 
+	(
+		tvec1<T> const & v
+	)
+	{
+		return tvec1<T>(
+			~v.x);
+	}
+
+	//////////////////////////////////////
+	// tref definition
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tref1<T>::tref1
+	(
+		T & x
+	) :
+		x(x)
+	{}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tref1<T>::tref1
+	(
+		tref1<T> const & r
+	) :
+		x(r.x)
+	{}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tref1<T>::tref1
+	(
+		tvec1<T> const & v
+	) :
+		x(v.x)
+	{}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tref1<T> & tref1<T>::operator= 
+	(
+		tref1<T> const & r
+	)
+	{
+		x = r.x;
+		return *this;
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tref1<T> & tref1<T>::operator= 
+	(
+		tvec1<T> const & v
+	)
+	{
+		x = v.x;
+		return *this;
+	}
+
+}//namespace detail
 }//namespace glm

+ 997 - 998
glm/core/type_vec2.inl

@@ -7,1005 +7,1004 @@
 // File    : glm/core/type_tvec2.inl
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-namespace glm
+namespace glm{
+namespace detail
 {
-	namespace detail
-	{
-		template <typename T>
-		GLM_FUNC_QUALIFIER typename tvec2<T>::size_type tvec2<T>::length() const
-		{
-			return 2;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER typename tvec2<T>::size_type tvec2<T>::value_size()
-		{
-			return 2;
-		}
-
-		//////////////////////////////////////
-		// Accesses
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER typename tvec2<T>::value_type & 
-		tvec2<T>::operator[]
-		(
-			size_type i
-		)
-		{
-			assert(i < value_size());
-			return (&x)[i];
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER typename tvec2<T>::value_type const & 
-		tvec2<T>::operator[]
-		(
-			size_type i
-		) const
-		{
-			assert(i < value_size());
-			return (&x)[i];
-		}
-
-		//////////////////////////////////////
-		// Implicit basic constructors
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T>::tvec2() :
-			x(value_type(0)),
-			y(value_type(0))
-		{}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T>::tvec2
-		(
-			ctor
-		)
-		{}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T>::tvec2
-		(
-			tvec2<T> const & v
-		) :
-			x(v.x),
-			y(v.y)
-		{}
-
-		//////////////////////////////////////
-		// Explicit basic constructors
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T>::tvec2
-		(
-			value_type const & s
-		) :
-			x(s),
-			y(s)
-		{}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T>::tvec2
-		(
-			value_type const & s1, 
-			value_type const & s2
-		) :
-			x(s1),
-			y(s2)
-		{}
-
-		//////////////////////////////////////
-		// Swizzle constructors
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T>::tvec2
-		(
-			tref2<T> const & r
-		) :
-			x(r.x),
-			y(r.y)
-		{}
-
-		//////////////////////////////////////
-		// Convertion scalar constructors
+	template <typename T>
+	GLM_FUNC_QUALIFIER typename tvec2<T>::size_type tvec2<T>::length() const
+	{
+		return 2;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER typename tvec2<T>::size_type tvec2<T>::value_size()
+	{
+		return 2;
+	}
+
+	//////////////////////////////////////
+	// Accesses
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER typename tvec2<T>::value_type & 
+	tvec2<T>::operator[]
+	(
+		size_type i
+	)
+	{
+		assert(i < value_size());
+		return (&x)[i];
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER typename tvec2<T>::value_type const & 
+	tvec2<T>::operator[]
+	(
+		size_type i
+	) const
+	{
+		assert(i < value_size());
+		return (&x)[i];
+	}
+
+	//////////////////////////////////////
+	// Implicit basic constructors
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T>::tvec2() :
+		x(value_type(0)),
+		y(value_type(0))
+	{}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T>::tvec2
+	(
+		ctor
+	)
+	{}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T>::tvec2
+	(
+		tvec2<T> const & v
+	) :
+		x(v.x),
+		y(v.y)
+	{}
+
+	//////////////////////////////////////
+	// Explicit basic constructors
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T>::tvec2
+	(
+		value_type const & s
+	) :
+		x(s),
+		y(s)
+	{}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T>::tvec2
+	(
+		value_type const & s1, 
+		value_type const & s2
+	) :
+		x(s1),
+		y(s2)
+	{}
+
+	//////////////////////////////////////
+	// Swizzle constructors
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T>::tvec2
+	(
+		tref2<T> const & r
+	) :
+		x(r.x),
+		y(r.y)
+	{}
+
+	//////////////////////////////////////
+	// Convertion scalar constructors
 		
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T>::tvec2
-		(
-			U const & x
-		) :
-			x(value_type(x)),
-			y(value_type(x))
-		{}
-
-		template <typename T>
-		template <typename U, typename V> 
-		GLM_FUNC_QUALIFIER tvec2<T>::tvec2
-		(
-			U const & x, 
-			V const & y
-		) :
-			x(value_type(x)),
-			y(value_type(y))
-		{}
-
-		//////////////////////////////////////
-		// Convertion vector constructors
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T>::tvec2
-		(
-			tvec2<U> const & v
-		) :
-			x(value_type(v.x)),
-			y(value_type(v.y))
-		{}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T>::tvec2
-		(
-			tvec3<U> const & v
-		) :
-			x(value_type(v.x)),
-			y(value_type(v.y))
-		{}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T>::tvec2
-		(
-			tvec4<U> const & v
-		) :
-			x(value_type(v.x)),
-			y(value_type(v.y))
-		{}
-
-		//////////////////////////////////////
-		// Unary arithmetic operators
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator= 
-		(
-			tvec2<T> const & v
-		)
-		{
-			this->x = v.x;
-			this->y = v.y;
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator= 
-		(
-			tvec2<U> const & v
-		)
-		{
-			this->x = T(v.x);
-			this->y = T(v.y);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator+=
-		(
-			U const & s
-		)
-		{
-			this->x += T(s);
-			this->y += T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator+=
-		(
-			tvec2<U> const & v
-		)
-		{
-			this->x += T(v.x);
-			this->y += T(v.y);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator-=
-		(
-			U const & s
-		)
-		{
-			this->x -= T(s);
-			this->y -= T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator-=
-		(
-			tvec2<U> const & v
-		)
-		{
-			this->x -= T(v.x);
-			this->y -= T(v.y);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator*=
-		(
-			U const & s
-		)
-		{
-			this->x *= T(s);
-			this->y *= T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator*=
-		(
-			tvec2<U> const & v
-		)
-		{
-			this->x *= T(v.x);
-			this->y *= T(v.y);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator/=
-		(
-			U const & s
-		)
-		{
-			this->x /= T(s);
-			this->y /= T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator/=
-		(
-			tvec2<U> const & v
-		)
-		{
-			this->x /= T(v.x);
-			this->y /= T(v.y);
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator++()
-		{
-			++this->x;
-			++this->y;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator--()
-		{
-			--this->x;
-			--this->y;
-			return *this;
-		}
-
-		//////////////////////////////////////
-		// Boolean operators
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER bool operator==
-		(
-			tvec2<T> const & v1, 
-			tvec2<T> const & v2
-		)
-		{
-			return (v1.x == v2.x) && (v1.y == v2.y);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER bool operator!=
-		(
-			tvec2<T> const & v1, 
-			tvec2<T> const & v2
-		)
-		{
-			return (v1.x != v2.x) || (v1.y != v2.y);
-		}
-
-		//////////////////////////////////////
-		// Unary bit operators
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator%=
-		(
-			U const & s
-		)
-		{
-			this->x %= T(s);
-			this->y %= T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator%=
-		(
-			tvec2<U> const & v
-		)
-		{
-			this->x %= T(v.x);
-			this->y %= T(v.y);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator&=
-		(
-			U const & s
-		)
-		{
-			this->x &= T(s);
-			this->y &= T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator&=
-		(
-			tvec2<U> const & v
-		)
-		{
-			this->x &= T(v.x);
-			this->y &= T(v.y);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator|=
-		(
-			U const & s
-		)
-		{
-			this->x |= T(s);
-			this->y |= T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator|=
-		(
-			tvec2<U> const & v
-		)
-		{
-			this->x |= T(v.x);
-			this->y |= T(v.y);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator^=
-		(
-			U const & s
-		)
-		{
-			this->x ^= T(s);
-			this->y ^= T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator^=
-		(
-			tvec2<U> const & v
-		)
-		{
-			this->x ^= T(v.x);
-			this->y ^= T(v.y);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator<<=
-		(
-			U const & s
-		)
-		{
-			this->x <<= T(s);
-			this->y <<= T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator<<=
-		(
-			tvec2<U> const & v
-		)
-		{
-			this->x <<= T(v.x);
-			this->y <<= T(v.y);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator>>=
-		(
-			U const & s
-		)
-		{
-			this->x >>= T(s);
-			this->y >>= T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator>>=
-		(
-			tvec2<U> const & v
-		)
-		{
-			this->x >>= T(v.x);
-			this->y >>= T(v.y);
-			return *this;
-		}
-
-		//////////////////////////////////////
-		// Swizzle operators
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER typename tvec2<T>::value_type tvec2<T>::swizzle
-		(
-			comp x
-		) const
-		{
-			return (*this)[x];
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> tvec2<T>::swizzle
-		(
-			comp x, 
-			comp y
-		) const
-		{
-			return tvec2<T>(
-				(*this)[x],
-				(*this)[y]);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> tvec2<T>::swizzle
-		(
-			comp x, 
-			comp y, 
-			comp z
-		) const
-		{
-			return tvec3<T>(
-				(*this)[x],
-				(*this)[y],
-				(*this)[z]);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> tvec2<T>::swizzle
-		(
-			comp x, 
-			comp y, 
-			comp z, 
-			comp w
-		) const
-		{
-			return tvec4<T>(
-				(*this)[x],
-				(*this)[y],
-				(*this)[z],
-				(*this)[w]);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tref2<T> tvec2<T>::swizzle
-		(
-			comp x, 
-			comp y
-		)
-		{
-			return tref2<T>(
-				(*this)[x],
-				(*this)[y]);
-		}
-
-		//////////////////////////////////////
-		// Binary arithmetic operators
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec2<T> operator+ 
-		(
-			tvec2<T> const & v, 
-			T const & s
-		)
-		{
-			return tvec2<T>(
-				v.x + T(s),
-				v.y + T(s));
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec2<T> operator+ 
-		(
-			T const & s, 
-			tvec2<T> const & v
-		)
-		{
-			return tvec2<T>(
-				T(s) + v.x,
-				T(s) + v.y);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec2<T> operator+ 
-		(
-			tvec2<T> const & v1, 
-			tvec2<T> const & v2
-		)
-		{
-			return tvec2<T>(
-				v1.x + T(v2.x),
-				v1.y + T(v2.y));
-		}
-
-		//operator-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec2<T> operator-
-		(
-			tvec2<T> const & v, 
-			T const & s
-		)
-		{
-			return tvec2<T>(
-				v.x - T(s),
-				v.y - T(s));
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec2<T> operator- 
-		(
-			T const & s, 
-			tvec2<T> const & v
-		)
-		{
-			return tvec2<T>(
-				T(s) - v.x,
-				T(s) - v.y);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec2<T> operator- 
-		(
-			tvec2<T> const & v1, 
-			tvec2<T> const & v2
-		)
-		{
-			return tvec2<T>(
-				v1.x - T(v2.x),
-				v1.y - T(v2.y));
-		}
-
-		//operator*
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec2<T> operator* 
-		(
-			tvec2<T> const & v, 
-			T const & s
-		)
-		{
-			return tvec2<T>(
-				v.x * T(s),
-				v.y * T(s));
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec2<T> operator* 
-		(
-			T const & s, 
-			tvec2<T> const & v
-		)
-		{
-			return tvec2<T>(
-				T(s) * v.x,
-				T(s) * v.y);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec2<T> operator*
-		(
-			tvec2<T> const & v1, 
-			tvec2<T> const & v2
-		)
-		{
-			return tvec2<T>(
-				v1.x * T(v2.x),
-				v1.y * T(v2.y));
-		}
-
-		//operator/
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec2<T> operator/
-		(
-			tvec2<T> const & v, 
-			T const & s
-		)
-		{
-			return tvec2<T>(
-				v.x / T(s),
-				v.y / T(s));
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec2<T> operator/
-		(
-			T const & s, 
-			tvec2<T> const & v
-		)
-		{
-			return tvec2<T>(
-				T(s) / v.x,
-				T(s) / v.y);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec2<T> operator/ 
-		(
-			tvec2<T> const & v1, 
-			tvec2<T> const & v2
-		)
-		{
-			return tvec2<T>(
-				v1.x / T(v2.x),
-				v1.y / T(v2.y));
-		}
-
-		// Unary constant operators
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec2<T> operator- 
-		(
-			tvec2<T> const & v
-		)
-		{
-			return tvec2<T>(
-				-v.x, 
-				-v.y);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec2<T> operator++ 
-		(
-			tvec2<T> const & v, 
-			int
-		)
-		{
-			return tvec2<T>(
-				v.x + T(1), 
-				v.y + T(1));
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec2<T> operator-- 
-		(
-			tvec2<T> const & v, 
-			int
-		)
-		{
-			return tvec2<T>(
-				v.x - T(1), 
-				v.y - T(1));
-		}
-
-		//////////////////////////////////////
-		// Binary bit operators
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> operator% 
-		(
-			tvec2<T> const & v, 
-			T const & s
-		)
-		{
-			return tvec2<T>(
-				v.x % T(s),
-				v.y % T(s));
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> operator%
-		(
-			T const & s, 
-			tvec2<T> const & v
-		)
-		{
-			return tvec2<T>(
-				T(s) % v.x,
-				T(s) % v.y);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> operator% 
-		(
-			tvec2<T> const & v1, 
-			tvec2<T> const & v2
-		)
-		{
-			return tvec2<T>(
-				v1.x % T(v2.x),
-				v1.y % T(v2.y));
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> operator& 
-		(
-			tvec2<T> const & v, 
-			T const & s
-		)
-		{
-			return tvec2<T>(
-				v.x & T(s),
-				v.y & T(s));
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> operator& 
-		(
-			T const & s, 
-			tvec2<T> const & v
-		)
-		{
-			return tvec2<T>(
-				T(s) & v.x,
-				T(s) & v.y);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> operator& 
-		(
-			tvec2<T> const & v1, 
-			tvec2<T> const & v2
-		)
-		{
-			return tvec2<T>(
-				v1.x & T(v2.x),
-				v1.y & T(v2.y));
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> operator| 
-		(
-			tvec2<T> const & v, 
-			T const & s
-		)
-		{
-			return tvec2<T>(
-				v.x | T(s),
-				v.y | T(s));
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> operator| 
-		(
-			T const & s, 
-			tvec2<T> const & v
-		)
-		{
-			return tvec2<T>(
-				T(s) | v.x,
-				T(s) | v.y);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> operator| 
-		(
-			tvec2<T> const & v1, 
-			tvec2<T> const & v2
-		)
-		{
-			return tvec2<T>(
-				v1.x | T(v2.x),
-				v1.y | T(v2.y));
-		}
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T>::tvec2
+	(
+		U const & x
+	) :
+		x(value_type(x)),
+		y(value_type(x))
+	{}
+
+	template <typename T>
+	template <typename U, typename V> 
+	GLM_FUNC_QUALIFIER tvec2<T>::tvec2
+	(
+		U const & x, 
+		V const & y
+	) :
+		x(value_type(x)),
+		y(value_type(y))
+	{}
+
+	//////////////////////////////////////
+	// Convertion vector constructors
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T>::tvec2
+	(
+		tvec2<U> const & v
+	) :
+		x(value_type(v.x)),
+		y(value_type(v.y))
+	{}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T>::tvec2
+	(
+		tvec3<U> const & v
+	) :
+		x(value_type(v.x)),
+		y(value_type(v.y))
+	{}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T>::tvec2
+	(
+		tvec4<U> const & v
+	) :
+		x(value_type(v.x)),
+		y(value_type(v.y))
+	{}
+
+	//////////////////////////////////////
+	// Unary arithmetic operators
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator= 
+	(
+		tvec2<T> const & v
+	)
+	{
+		this->x = v.x;
+		this->y = v.y;
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator= 
+	(
+		tvec2<U> const & v
+	)
+	{
+		this->x = T(v.x);
+		this->y = T(v.y);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator+=
+	(
+		U const & s
+	)
+	{
+		this->x += T(s);
+		this->y += T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator+=
+	(
+		tvec2<U> const & v
+	)
+	{
+		this->x += T(v.x);
+		this->y += T(v.y);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator-=
+	(
+		U const & s
+	)
+	{
+		this->x -= T(s);
+		this->y -= T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator-=
+	(
+		tvec2<U> const & v
+	)
+	{
+		this->x -= T(v.x);
+		this->y -= T(v.y);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator*=
+	(
+		U const & s
+	)
+	{
+		this->x *= T(s);
+		this->y *= T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator*=
+	(
+		tvec2<U> const & v
+	)
+	{
+		this->x *= T(v.x);
+		this->y *= T(v.y);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator/=
+	(
+		U const & s
+	)
+	{
+		this->x /= T(s);
+		this->y /= T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator/=
+	(
+		tvec2<U> const & v
+	)
+	{
+		this->x /= T(v.x);
+		this->y /= T(v.y);
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator++()
+	{
+		++this->x;
+		++this->y;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator--()
+	{
+		--this->x;
+		--this->y;
+		return *this;
+	}
+
+	//////////////////////////////////////
+	// Boolean operators
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER bool operator==
+	(
+		tvec2<T> const & v1, 
+		tvec2<T> const & v2
+	)
+	{
+		return (v1.x == v2.x) && (v1.y == v2.y);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER bool operator!=
+	(
+		tvec2<T> const & v1, 
+		tvec2<T> const & v2
+	)
+	{
+		return (v1.x != v2.x) || (v1.y != v2.y);
+	}
+
+	//////////////////////////////////////
+	// Unary bit operators
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator%=
+	(
+		U const & s
+	)
+	{
+		this->x %= T(s);
+		this->y %= T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator%=
+	(
+		tvec2<U> const & v
+	)
+	{
+		this->x %= T(v.x);
+		this->y %= T(v.y);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator&=
+	(
+		U const & s
+	)
+	{
+		this->x &= T(s);
+		this->y &= T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator&=
+	(
+		tvec2<U> const & v
+	)
+	{
+		this->x &= T(v.x);
+		this->y &= T(v.y);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator|=
+	(
+		U const & s
+	)
+	{
+		this->x |= T(s);
+		this->y |= T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator|=
+	(
+		tvec2<U> const & v
+	)
+	{
+		this->x |= T(v.x);
+		this->y |= T(v.y);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator^=
+	(
+		U const & s
+	)
+	{
+		this->x ^= T(s);
+		this->y ^= T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator^=
+	(
+		tvec2<U> const & v
+	)
+	{
+		this->x ^= T(v.x);
+		this->y ^= T(v.y);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator<<=
+	(
+		U const & s
+	)
+	{
+		this->x <<= T(s);
+		this->y <<= T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator<<=
+	(
+		tvec2<U> const & v
+	)
+	{
+		this->x <<= T(v.x);
+		this->y <<= T(v.y);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator>>=
+	(
+		U const & s
+	)
+	{
+		this->x >>= T(s);
+		this->y >>= T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec2<T> & tvec2<T>::operator>>=
+	(
+		tvec2<U> const & v
+	)
+	{
+		this->x >>= T(v.x);
+		this->y >>= T(v.y);
+		return *this;
+	}
+
+	//////////////////////////////////////
+	// Swizzle operators
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER typename tvec2<T>::value_type tvec2<T>::swizzle
+	(
+		comp x
+	) const
+	{
+		return (*this)[x];
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> tvec2<T>::swizzle
+	(
+		comp x, 
+		comp y
+	) const
+	{
+		return tvec2<T>(
+			(*this)[x],
+			(*this)[y]);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> tvec2<T>::swizzle
+	(
+		comp x, 
+		comp y, 
+		comp z
+	) const
+	{
+		return tvec3<T>(
+			(*this)[x],
+			(*this)[y],
+			(*this)[z]);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> tvec2<T>::swizzle
+	(
+		comp x, 
+		comp y, 
+		comp z, 
+		comp w
+	) const
+	{
+		return tvec4<T>(
+			(*this)[x],
+			(*this)[y],
+			(*this)[z],
+			(*this)[w]);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tref2<T> tvec2<T>::swizzle
+	(
+		comp x, 
+		comp y
+	)
+	{
+		return tref2<T>(
+			(*this)[x],
+			(*this)[y]);
+	}
+
+	//////////////////////////////////////
+	// Binary arithmetic operators
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec2<T> operator+ 
+	(
+		tvec2<T> const & v, 
+		T const & s
+	)
+	{
+		return tvec2<T>(
+			v.x + T(s),
+			v.y + T(s));
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec2<T> operator+ 
+	(
+		T const & s, 
+		tvec2<T> const & v
+	)
+	{
+		return tvec2<T>(
+			T(s) + v.x,
+			T(s) + v.y);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec2<T> operator+ 
+	(
+		tvec2<T> const & v1, 
+		tvec2<T> const & v2
+	)
+	{
+		return tvec2<T>(
+			v1.x + T(v2.x),
+			v1.y + T(v2.y));
+	}
+
+	//operator-
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec2<T> operator-
+	(
+		tvec2<T> const & v, 
+		T const & s
+	)
+	{
+		return tvec2<T>(
+			v.x - T(s),
+			v.y - T(s));
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec2<T> operator- 
+	(
+		T const & s, 
+		tvec2<T> const & v
+	)
+	{
+		return tvec2<T>(
+			T(s) - v.x,
+			T(s) - v.y);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec2<T> operator- 
+	(
+		tvec2<T> const & v1, 
+		tvec2<T> const & v2
+	)
+	{
+		return tvec2<T>(
+			v1.x - T(v2.x),
+			v1.y - T(v2.y));
+	}
+
+	//operator*
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec2<T> operator* 
+	(
+		tvec2<T> const & v, 
+		T const & s
+	)
+	{
+		return tvec2<T>(
+			v.x * T(s),
+			v.y * T(s));
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec2<T> operator* 
+	(
+		T const & s, 
+		tvec2<T> const & v
+	)
+	{
+		return tvec2<T>(
+			T(s) * v.x,
+			T(s) * v.y);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec2<T> operator*
+	(
+		tvec2<T> const & v1, 
+		tvec2<T> const & v2
+	)
+	{
+		return tvec2<T>(
+			v1.x * T(v2.x),
+			v1.y * T(v2.y));
+	}
+
+	//operator/
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec2<T> operator/
+	(
+		tvec2<T> const & v, 
+		T const & s
+	)
+	{
+		return tvec2<T>(
+			v.x / T(s),
+			v.y / T(s));
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec2<T> operator/
+	(
+		T const & s, 
+		tvec2<T> const & v
+	)
+	{
+		return tvec2<T>(
+			T(s) / v.x,
+			T(s) / v.y);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec2<T> operator/ 
+	(
+		tvec2<T> const & v1, 
+		tvec2<T> const & v2
+	)
+	{
+		return tvec2<T>(
+			v1.x / T(v2.x),
+			v1.y / T(v2.y));
+	}
+
+	// Unary constant operators
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec2<T> operator- 
+	(
+		tvec2<T> const & v
+	)
+	{
+		return tvec2<T>(
+			-v.x, 
+			-v.y);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec2<T> operator++ 
+	(
+		tvec2<T> const & v, 
+		int
+	)
+	{
+		return tvec2<T>(
+			v.x + T(1), 
+			v.y + T(1));
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec2<T> operator-- 
+	(
+		tvec2<T> const & v, 
+		int
+	)
+	{
+		return tvec2<T>(
+			v.x - T(1), 
+			v.y - T(1));
+	}
+
+	//////////////////////////////////////
+	// Binary bit operators
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> operator% 
+	(
+		tvec2<T> const & v, 
+		T const & s
+	)
+	{
+		return tvec2<T>(
+			v.x % T(s),
+			v.y % T(s));
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> operator%
+	(
+		T const & s, 
+		tvec2<T> const & v
+	)
+	{
+		return tvec2<T>(
+			T(s) % v.x,
+			T(s) % v.y);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> operator% 
+	(
+		tvec2<T> const & v1, 
+		tvec2<T> const & v2
+	)
+	{
+		return tvec2<T>(
+			v1.x % T(v2.x),
+			v1.y % T(v2.y));
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> operator& 
+	(
+		tvec2<T> const & v, 
+		T const & s
+	)
+	{
+		return tvec2<T>(
+			v.x & T(s),
+			v.y & T(s));
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> operator& 
+	(
+		T const & s, 
+		tvec2<T> const & v
+	)
+	{
+		return tvec2<T>(
+			T(s) & v.x,
+			T(s) & v.y);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> operator& 
+	(
+		tvec2<T> const & v1, 
+		tvec2<T> const & v2
+	)
+	{
+		return tvec2<T>(
+			v1.x & T(v2.x),
+			v1.y & T(v2.y));
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> operator| 
+	(
+		tvec2<T> const & v, 
+		T const & s
+	)
+	{
+		return tvec2<T>(
+			v.x | T(s),
+			v.y | T(s));
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> operator| 
+	(
+		T const & s, 
+		tvec2<T> const & v
+	)
+	{
+		return tvec2<T>(
+			T(s) | v.x,
+			T(s) | v.y);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> operator| 
+	(
+		tvec2<T> const & v1, 
+		tvec2<T> const & v2
+	)
+	{
+		return tvec2<T>(
+			v1.x | T(v2.x),
+			v1.y | T(v2.y));
+	}
 		
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> operator^ 
-		(
-			tvec2<T> const & v, 
-			T const & s
-		)
-		{
-			return tvec2<T>(
-				v.x ^ T(s),
-				v.y ^ T(s));
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> operator^ 
-		(
-			T const & s, 
-			tvec2<T> const & v
-		)
-		{
-			return tvec2<T>(
-				T(s) ^ v.x,
-				T(s) ^ v.y);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> operator^ 
-		(
-			tvec2<T> const & v1, 
-			tvec2<T> const & v2
-		)
-		{
-			return tvec2<T>(
-				v1.x ^ T(v2.x),
-				v1.y ^ T(v2.y));
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> operator<< 
-		(
-			tvec2<T> const & v, 
-			T const & s
-		)
-		{
-			return tvec2<T>(
-				v.x << T(s),
-				v.y << T(s));
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> operator<< 
-		(
-			T const & s, 
-			tvec2<T> const & v
-		)
-		{
-			return tvec2<T>(
-				s << T(v.x),
-				s << T(v.y));
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> operator<< 
-		(
-			tvec2<T> const & v1, 
-			tvec2<T> const & v2
-		)
-		{
-			return tvec2<T>(
-				v1.x << T(v2.x),
-				v1.y << T(v2.y));
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> operator>> 
-		(
-			tvec2<T> const & v, 
-			T const & s
-		)
-		{
-			return tvec2<T>(
-				v.x >> T(s),
-				v.y >> T(s));
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> operator>> 
-		(
-			T const & s, 
-			tvec2<T> const & v
-		)
-		{
-			return tvec2<T>(
-				T(s) >> v.x,
-				T(s) >> v.y);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> operator>>
-		(
-			tvec2<T> const & v1, 
-			tvec2<T> const & v2
-		)
-		{
-			return tvec2<T>(
-				v1.x >> T(v2.x),
-				v1.y >> T(v2.y));
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec2<T> operator~ 
-		(
-			tvec2<T> const & v
-		)
-		{
-			return tvec2<T>(
-				~v.x,
-				~v.y);
-		}
-
-		//////////////////////////////////////
-		// tref definition
-
-		template <typename T> 
-		tref2<T>::tref2
-		(
-			T & x, 
-			T & y
-		) :
-			x(x),
-			y(y)
-		{}
-
-		template <typename T> 
-		tref2<T>::tref2
-		(
-			tref2<T> const & r
-		) :
-			x(r.x),
-			y(r.y)
-		{}
-
-		template <typename T> 
-		tref2<T>::tref2
-		(
-			tvec2<T> const & v
-		) :
-			x(v.x),
-			y(v.y)
-		{}
-
-		template <typename T> 
-		tref2<T>& tref2<T>::operator= 
-		(
-			tref2<T> const & r
-		)
-		{
-			x = r.x;
-			y = r.y;
-			return *this;
-		}
-
-		template <typename T> 
-		tref2<T>& tref2<T>::operator= 
-		(
-			tvec2<T> const & v
-		)
-		{
-			x = v.x;
-			y = v.y;
-			return *this;
-		}
-
-	}//namespace detail
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> operator^ 
+	(
+		tvec2<T> const & v, 
+		T const & s
+	)
+	{
+		return tvec2<T>(
+			v.x ^ T(s),
+			v.y ^ T(s));
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> operator^ 
+	(
+		T const & s, 
+		tvec2<T> const & v
+	)
+	{
+		return tvec2<T>(
+			T(s) ^ v.x,
+			T(s) ^ v.y);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> operator^ 
+	(
+		tvec2<T> const & v1, 
+		tvec2<T> const & v2
+	)
+	{
+		return tvec2<T>(
+			v1.x ^ T(v2.x),
+			v1.y ^ T(v2.y));
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> operator<< 
+	(
+		tvec2<T> const & v, 
+		T const & s
+	)
+	{
+		return tvec2<T>(
+			v.x << T(s),
+			v.y << T(s));
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> operator<< 
+	(
+		T const & s, 
+		tvec2<T> const & v
+	)
+	{
+		return tvec2<T>(
+			s << T(v.x),
+			s << T(v.y));
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> operator<< 
+	(
+		tvec2<T> const & v1, 
+		tvec2<T> const & v2
+	)
+	{
+		return tvec2<T>(
+			v1.x << T(v2.x),
+			v1.y << T(v2.y));
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> operator>> 
+	(
+		tvec2<T> const & v, 
+		T const & s
+	)
+	{
+		return tvec2<T>(
+			v.x >> T(s),
+			v.y >> T(s));
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> operator>> 
+	(
+		T const & s, 
+		tvec2<T> const & v
+	)
+	{
+		return tvec2<T>(
+			T(s) >> v.x,
+			T(s) >> v.y);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> operator>>
+	(
+		tvec2<T> const & v1, 
+		tvec2<T> const & v2
+	)
+	{
+		return tvec2<T>(
+			v1.x >> T(v2.x),
+			v1.y >> T(v2.y));
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec2<T> operator~ 
+	(
+		tvec2<T> const & v
+	)
+	{
+		return tvec2<T>(
+			~v.x,
+			~v.y);
+	}
+
+	//////////////////////////////////////
+	// tref definition
+
+	template <typename T> 
+	tref2<T>::tref2
+	(
+		T & x, 
+		T & y
+	) :
+		x(x),
+		y(y)
+	{}
+
+	template <typename T> 
+	tref2<T>::tref2
+	(
+		tref2<T> const & r
+	) :
+		x(r.x),
+		y(r.y)
+	{}
+
+	template <typename T> 
+	tref2<T>::tref2
+	(
+		tvec2<T> const & v
+	) :
+		x(v.x),
+		y(v.y)
+	{}
+
+	template <typename T> 
+	tref2<T>& tref2<T>::operator= 
+	(
+		tref2<T> const & r
+	)
+	{
+		x = r.x;
+		y = r.y;
+		return *this;
+	}
+
+	template <typename T> 
+	tref2<T>& tref2<T>::operator= 
+	(
+		tvec2<T> const & v
+	)
+	{
+		x = v.x;
+		y = v.y;
+		return *this;
+	}
+
+}//namespace detail
 }//namespace glm

+ 1084 - 1085
glm/core/type_vec3.inl

@@ -7,1092 +7,1091 @@
 // File    : glm/core/type_tvec3.inl
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-namespace glm
+namespace glm{
+namespace detail
 {
-	namespace detail
-	{
-		template <typename T>
-		GLM_FUNC_QUALIFIER typename tvec3<T>::size_type tvec3<T>::length() const
-		{
-			return 3;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER typename tvec3<T>::size_type tvec3<T>::value_size()
-		{
-			return 3;
-		}
-
-		//////////////////////////////////////
-		// Accesses
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER typename tvec3<T>::value_type & 
-		tvec3<T>::operator[]
-		(
-			size_type i
-		)
-		{
-			assert(i < value_size());
-			return (&x)[i];
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER typename tvec3<T>::value_type const & 
-		tvec3<T>::operator[]
-		(
-			size_type i
-		) const
-		{
-			assert(i < value_size());
-			return (&x)[i];
-		}
-
-		//////////////////////////////////////
-		// Implicit basic constructors
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T>::tvec3() :
-			x(value_type(0)),
-			y(value_type(0)),
-			z(value_type(0))
-		{}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T>::tvec3
-		(
-			ctor
-		)
-		{}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T>::tvec3
-		(
-			tvec3<T> const & v
-		) :
-			x(v.x),
-			y(v.y),
-			z(v.z)
-		{}
-
-		//////////////////////////////////////
-		// Explicit basic constructors
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T>::tvec3
-		(
-			value_type const & s
-		) :
-			x(s),
-			y(s),
-			z(s)
-		{}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T>::tvec3
-		(
-			value_type const & s0, 
-			value_type const & s1, 
-			value_type const & s2
-		) :
-			x(s0),
-			y(s1),
-			z(s2)
-		{}
-
-		//////////////////////////////////////
-		// Swizzle constructors
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T>::tvec3
-		(
-			tref3<T> const & r
-		) :
-			x(r.x),
-			y(r.y),
-			z(r.z)
-		{}
-
-		//////////////////////////////////////
-		// Convertion scalar constructors
+	template <typename T>
+	GLM_FUNC_QUALIFIER typename tvec3<T>::size_type tvec3<T>::length() const
+	{
+		return 3;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER typename tvec3<T>::size_type tvec3<T>::value_size()
+	{
+		return 3;
+	}
+
+	//////////////////////////////////////
+	// Accesses
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER typename tvec3<T>::value_type & 
+	tvec3<T>::operator[]
+	(
+		size_type i
+	)
+	{
+		assert(i < value_size());
+		return (&x)[i];
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER typename tvec3<T>::value_type const & 
+	tvec3<T>::operator[]
+	(
+		size_type i
+	) const
+	{
+		assert(i < value_size());
+		return (&x)[i];
+	}
+
+	//////////////////////////////////////
+	// Implicit basic constructors
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T>::tvec3() :
+		x(value_type(0)),
+		y(value_type(0)),
+		z(value_type(0))
+	{}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T>::tvec3
+	(
+		ctor
+	)
+	{}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T>::tvec3
+	(
+		tvec3<T> const & v
+	) :
+		x(v.x),
+		y(v.y),
+		z(v.z)
+	{}
+
+	//////////////////////////////////////
+	// Explicit basic constructors
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T>::tvec3
+	(
+		value_type const & s
+	) :
+		x(s),
+		y(s),
+		z(s)
+	{}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T>::tvec3
+	(
+		value_type const & s0, 
+		value_type const & s1, 
+		value_type const & s2
+	) :
+		x(s0),
+		y(s1),
+		z(s2)
+	{}
+
+	//////////////////////////////////////
+	// Swizzle constructors
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T>::tvec3
+	(
+		tref3<T> const & r
+	) :
+		x(r.x),
+		y(r.y),
+		z(r.z)
+	{}
+
+	//////////////////////////////////////
+	// Convertion scalar constructors
 		
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T>::tvec3
-		(
-			U const & s
-		) :
-			x(value_type(s)),
-			y(value_type(s)),
-			z(value_type(s))
-		{}
-
-		template <typename T>
-		template <typename A, typename B, typename C> 
-		GLM_FUNC_QUALIFIER tvec3<T>::tvec3
-		(
-			A const & x, 
-			B const & y, 
-			C const & z
-		) :
-			x(value_type(x)),
-			y(value_type(y)),
-			z(value_type(z))
-		{}
-
-		//////////////////////////////////////
-		// Convertion vector constructors
-
-		template <typename T>
-		template <typename A, typename B> 
-		GLM_FUNC_QUALIFIER tvec3<T>::tvec3
-		(
-			tvec2<A> const & v, 
-			B const & s
-		) :
-			x(value_type(v.x)),
-			y(value_type(v.y)),
-			z(value_type(s))
-		{}
-
-		template <typename T>
-		template <typename A, typename B> 
-		GLM_FUNC_QUALIFIER tvec3<T>::tvec3
-		(	
-			A const & s, 
-			tvec2<B> const & v
-		) :
-			x(value_type(s)),
-			y(value_type(v.x)),
-			z(value_type(v.y))
-		{}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T>::tvec3
-		(
-			tvec3<U> const & v
-		) :
-			x(value_type(v.x)),
-			y(value_type(v.y)),
-			z(value_type(v.z))
-		{}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T>::tvec3
-		(
-			tvec4<U> const & v
-		) :
-			x(value_type(v.x)),
-			y(value_type(v.y)),
-			z(value_type(v.z))
-		{}
-
-		//////////////////////////////////////
-		// Unary arithmetic operators
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T>& tvec3<T>::operator= 
-		(
-			tvec3<T> const & v
-		)
-		{
-			this->x = v.x;
-			this->y = v.y;
-			this->z = v.z;
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T>& tvec3<T>::operator= 
-		(
-			tvec3<U> const & v
-		)
-		{
-			this->x = T(v.x);
-			this->y = T(v.y);
-			this->z = T(v.z);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator+=
-		(
-			U const & s
-		)
-		{
-			this->x += T(s);
-			this->y += T(s);
-			this->z += T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator+=
-		(
-			tvec3<U> const & v
-		)
-		{
-			this->x += T(v.x);
-			this->y += T(v.y);
-			this->z += T(v.z);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator-=
-		(
-			U const & s
-		)
-		{
-			this->x -= T(s);
-			this->y -= T(s);
-			this->z -= T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator-=
-		(
-			tvec3<U> const & v
-		)
-		{
-			this->x -= T(v.x);
-			this->y -= T(v.y);
-			this->z -= T(v.z);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator*=
-		(
-			U const & s
-		)
-		{
-			this->x *= T(s);
-			this->y *= T(s);
-			this->z *= T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator*=
-		(
-			tvec3<U> const & v
-		)
-		{
-			this->x *= T(v.x);
-			this->y *= T(v.y);
-			this->z *= T(v.z);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator/=
-		(
-			U const & s
-		)
-		{
-			this->x /= T(s);
-			this->y /= T(s);
-			this->z /= T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator/=
-		(
-			tvec3<U> const & v
-		)
-		{
-			this->x /= T(v.x);
-			this->y /= T(v.y);
-			this->z /= T(v.z);
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator++()
-		{
-			++this->x;
-			++this->y;
-			++this->z;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator--()
-		{
-			--this->x;
-			--this->y;
-			--this->z;
-			return *this;
-		}
-
-		//////////////////////////////////////
-		// Boolean operators
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER bool operator==
-		(
-			tvec3<T> const & v1, 
-			tvec3<T> const & v2
-		)
-		{
-			return (v1.x == v2.x) && (v1.y == v2.y) && (v1.z == v2.z);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER bool operator!=
-		(
-			tvec3<T> const & v1, 
-			tvec3<T> const & v2
-		)
-		{
-			return (v1.x != v2.x) || (v1.y != v2.y) || (v1.z != v2.z);
-		}
-
-		//////////////////////////////////////
-		// Unary bit operators
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator%=
-		(
-			U const & s
-		)
-		{
-			this->x %= s;
-			this->y %= s;
-			this->z %= s;
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator%=
-		(
-			tvec3<U> const & v
-		)
-		{
-			this->x %= v.x;
-			this->y %= v.y;
-			this->z %= v.z;
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator&=
-		(	
-			U const & s
-		)
-		{
-			this->x &= s;
-			this->y &= s;
-			this->z &= s;
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator&=
-		(
-			tvec3<U> const & v
-		)
-		{
-			this->x &= v.x;
-			this->y &= v.y;
-			this->z &= v.z;
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator|=
-		(
-			U const & s
-		)
-		{
-			this->x |= s;
-			this->y |= s;
-			this->z |= s;
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator|=
-		(
-			tvec3<U> const & v
-		)
-		{
-			this->x |= v.x;
-			this->y |= v.y;
-			this->z |= v.z;
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator^=
-		(
-			U const & s
-		)
-		{
-			this->x ^= s;
-			this->y ^= s;
-			this->z ^= s;
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator^=
-		(
-			tvec3<U> const & v
-		)
-		{
-			this->x ^= v.x;
-			this->y ^= v.y;
-			this->z ^= v.z;
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator<<=
-		(
-			U const & s
-		)
-		{
-			this->x <<= s;
-			this->y <<= s;
-			this->z <<= s;
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator<<=
-		(
-			tvec3<U> const & v
-		)
-		{
-			this->x <<= T(v.x);
-			this->y <<= T(v.y);
-			this->z <<= T(v.z);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator>>=
-		(
-			U const & s
-		)
-		{
-			this->x >>= T(s);
-			this->y >>= T(s);
-			this->z >>= T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator>>=
-		(
-			tvec3<U> const & v
-		)
-		{
-			this->x >>= T(v.x);
-			this->y >>= T(v.y);
-			this->z >>= T(v.z);
-			return *this;
-		}
-
-		//////////////////////////////////////
-		// Swizzle operators
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER typename tvec3<T>::value_type 
-		tvec3<T>::swizzle
-		(
-			comp x
-		) const
-		{
-			return (*this)[x];
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> tvec3<T>::swizzle
-		(
-			comp x, 
-			comp y
-		) const
-		{
-			return tvec2<T>(
-				(*this)[x],
-				(*this)[y]);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> tvec3<T>::swizzle
-		(
-			comp x, 
-			comp y, 
-			comp z
-		) const
-		{
-			return tvec3<T>(
-				(*this)[x],
-				(*this)[y],
-				(*this)[z]);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> tvec3<T>::swizzle
-		(
-			comp x, 
-			comp y, 
-			comp z, 
-			comp w
-		) const
-		{
-			return tvec4<T>(
-				(*this)[x],
-				(*this)[y],
-				(*this)[z],
-				(*this)[w]);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tref3<T> tvec3<T>::swizzle
-		(
-			comp x, 
-			comp y, 
-			comp z
-		)
-		{
-			return tref3<T>(
-				(*this)[x],
-				(*this)[y],
-				(*this)[z]);
-		}
-
-		//////////////////////////////////////
-		// Binary arithmetic operators
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec3<T> operator+
-		(
-			tvec3<T> const & v, 
-			T const & s
-		)
-		{
-			return tvec3<T>(
-				v.x + T(s),
-				v.y + T(s),
-				v.z + T(s));
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec3<T> operator+ 
-		(
-			T const & s, 
-			tvec3<T> const & v
-		)
-		{
-			return tvec3<T>(
-				T(s) + v.x,
-				T(s) + v.y,
-				T(s) + v.z);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec3<T> operator+ 
-		(
-			tvec3<T> const & v1, 
-			tvec3<T> const & v2
-		)
-		{
-			return tvec3<T>(
-				v1.x + T(v2.x),
-				v1.y + T(v2.y),
-				v1.z + T(v2.z));
-		}
-
-		//operator-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec3<T> operator- 
-		(
-			tvec3<T> const & v, 
-			T const & s
-		)
-		{
-			return tvec3<T>(
-				v.x - T(s),
-				v.y - T(s),
-				v.z - T(s));
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec3<T> operator- 
-		(
-			T const & s, 
-			tvec3<T> const & v
-		)
-		{
-			return tvec3<T>(
-				T(s) - v.x,
-				T(s) - v.y,
-				T(s) - v.z);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec3<T> operator- 
-		(
-			tvec3<T> const & v1, 
-			tvec3<T> const & v2
-		)
-		{
-			return tvec3<T>(
-				v1.x - T(v2.x),
-				v1.y - T(v2.y),
-				v1.z - T(v2.z));
-		}
-
-		//operator*
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec3<T> operator*
-		(
-			tvec3<T> const & v, 
-			T const & s
-		)
-		{
-			return tvec3<T>(
-				v.x * T(s),
-				v.y * T(s),
-				v.z * T(s));
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec3<T> operator* 
-		(
-			T const & s, 
-			tvec3<T> const & v
-		)
-		{
-			return tvec3<T>(
-				T(s) * v.x,
-				T(s) * v.y,
-				T(s) * v.z);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec3<T> operator* 
-		(
-			tvec3<T> const & v1, 
-			tvec3<T> const & v2
-		)
-		{
-			return tvec3<T>(
-				v1.x * T(v2.x),
-				v1.y * T(v2.y),
-				v1.z * T(v2.z));
-		}
-
-		//operator/
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec3<T> operator/
-		(
-			tvec3<T> const & v, 
-			T const & s
-		)
-		{
-			return tvec3<T>(
-				v.x / T(s),
-				v.y / T(s),
-				v.z / T(s));
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec3<T> operator/ 
-		(
-			T const & s, 
-			tvec3<T> const & v
-		)
-		{
-			return tvec3<T>(
-				T(s) / v.x,
-				T(s) / v.y,
-				T(s) / v.z);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec3<T> operator/ 
-		(
-			tvec3<T> const & v1, 
-			tvec3<T> const & v2
-		)
-		{
-			return tvec3<T>(
-				v1.x / T(v2.x),
-				v1.y / T(v2.y),
-				v1.z / T(v2.z));
-		}
-
-		// Unary constant operators
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec3<T> operator- 
-		(
-			tvec3<T> const & v
-		)
-		{
-			return tvec3<T>(
-				-v.x, 
-				-v.y, 
-				-v.z);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec3<T> operator++ 
-		(
-			tvec3<T> const & v, 
-			int
-		)
-		{
-			return tvec3<T>(
-				v.x + T(1), 
-				v.y + T(1), 
-				v.z + T(1));
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec3<T> operator-- 
-		(
-			tvec3<T> const & v, 
-			int
-		)
-		{
-			return tvec3<T>(
-				v.x - T(1), 
-				v.y - T(1), 
-				v.z - T(1));
-		}
-
-		//////////////////////////////////////
-		// Binary bit operators
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> operator% 
-		(
-			tvec3<T> const & v, 
-			T const & s
-		)
-		{
-			return tvec3<T>(
-				v.x % T(s),
-				v.y % T(s),
-				v.z % T(s));
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> operator%
-		(
-			T const & s, 
-			tvec3<T> const & v
-		)
-		{
-			return tvec3<T>(
-				T(s) % v.x,
-				T(s) % v.y,
-				T(s) % v.z);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> operator% 
-		(
-			tvec3<T> const & v1, 
-			tvec3<T> const & v2
-		)
-		{
-			return tvec3<T>(
-				v1.x % T(v2.x),
-				v1.y % T(v2.y),
-				v1.z % T(v2.z));
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> operator& 
-		(
-			tvec3<T> const & v, 
-			T const & s
-		)
-		{
-			return tvec3<T>(
-				v.x & T(s),
-				v.y & T(s),
-				v.z & T(s));
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> operator& 
-		(
-			T const & s, 
-			tvec3<T> const & v
-		)
-		{
-			return tvec3<T>(
-				T(s) & v.x,
-				T(s) & v.y,
-				T(s) & v.z);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> operator& 
-		(
-			tvec3<T> const & v1, 
-			tvec3<T> const & v2
-		)
-		{
-			return tvec3<T>(
-				v1.x & T(v2.x),
-				v1.y & T(v2.y),
-				v1.z & T(v2.z));
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> operator| 
-		(
-			tvec3<T> const & v, 
-			T const & s
-		)
-		{
-			return tvec3<T>(
-				v.x | T(s),
-				v.y | T(s),
-				v.z | T(s));
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> operator| 
-		(
-			T const & s, 
-			tvec3<T> const & v
-		)
-		{
-			return tvec3<T>(
-				T(s) | v.x,
-				T(s) | v.y,
-				T(s) | v.z);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> operator| 
-		(
-			tvec3<T> const & v1, 
-			tvec3<T> const & v2
-		)
-		{
-			return tvec3<T>(
-				v1.x | T(v2.x),
-				v1.y | T(v2.y),
-				v1.z | T(v2.z));
-		}
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T>::tvec3
+	(
+		U const & s
+	) :
+		x(value_type(s)),
+		y(value_type(s)),
+		z(value_type(s))
+	{}
+
+	template <typename T>
+	template <typename A, typename B, typename C> 
+	GLM_FUNC_QUALIFIER tvec3<T>::tvec3
+	(
+		A const & x, 
+		B const & y, 
+		C const & z
+	) :
+		x(value_type(x)),
+		y(value_type(y)),
+		z(value_type(z))
+	{}
+
+	//////////////////////////////////////
+	// Convertion vector constructors
+
+	template <typename T>
+	template <typename A, typename B> 
+	GLM_FUNC_QUALIFIER tvec3<T>::tvec3
+	(
+		tvec2<A> const & v, 
+		B const & s
+	) :
+		x(value_type(v.x)),
+		y(value_type(v.y)),
+		z(value_type(s))
+	{}
+
+	template <typename T>
+	template <typename A, typename B> 
+	GLM_FUNC_QUALIFIER tvec3<T>::tvec3
+	(	
+		A const & s, 
+		tvec2<B> const & v
+	) :
+		x(value_type(s)),
+		y(value_type(v.x)),
+		z(value_type(v.y))
+	{}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T>::tvec3
+	(
+		tvec3<U> const & v
+	) :
+		x(value_type(v.x)),
+		y(value_type(v.y)),
+		z(value_type(v.z))
+	{}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T>::tvec3
+	(
+		tvec4<U> const & v
+	) :
+		x(value_type(v.x)),
+		y(value_type(v.y)),
+		z(value_type(v.z))
+	{}
+
+	//////////////////////////////////////
+	// Unary arithmetic operators
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T>& tvec3<T>::operator= 
+	(
+		tvec3<T> const & v
+	)
+	{
+		this->x = v.x;
+		this->y = v.y;
+		this->z = v.z;
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T>& tvec3<T>::operator= 
+	(
+		tvec3<U> const & v
+	)
+	{
+		this->x = T(v.x);
+		this->y = T(v.y);
+		this->z = T(v.z);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator+=
+	(
+		U const & s
+	)
+	{
+		this->x += T(s);
+		this->y += T(s);
+		this->z += T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator+=
+	(
+		tvec3<U> const & v
+	)
+	{
+		this->x += T(v.x);
+		this->y += T(v.y);
+		this->z += T(v.z);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator-=
+	(
+		U const & s
+	)
+	{
+		this->x -= T(s);
+		this->y -= T(s);
+		this->z -= T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator-=
+	(
+		tvec3<U> const & v
+	)
+	{
+		this->x -= T(v.x);
+		this->y -= T(v.y);
+		this->z -= T(v.z);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator*=
+	(
+		U const & s
+	)
+	{
+		this->x *= T(s);
+		this->y *= T(s);
+		this->z *= T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator*=
+	(
+		tvec3<U> const & v
+	)
+	{
+		this->x *= T(v.x);
+		this->y *= T(v.y);
+		this->z *= T(v.z);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator/=
+	(
+		U const & s
+	)
+	{
+		this->x /= T(s);
+		this->y /= T(s);
+		this->z /= T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator/=
+	(
+		tvec3<U> const & v
+	)
+	{
+		this->x /= T(v.x);
+		this->y /= T(v.y);
+		this->z /= T(v.z);
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator++()
+	{
+		++this->x;
+		++this->y;
+		++this->z;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator--()
+	{
+		--this->x;
+		--this->y;
+		--this->z;
+		return *this;
+	}
+
+	//////////////////////////////////////
+	// Boolean operators
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER bool operator==
+	(
+		tvec3<T> const & v1, 
+		tvec3<T> const & v2
+	)
+	{
+		return (v1.x == v2.x) && (v1.y == v2.y) && (v1.z == v2.z);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER bool operator!=
+	(
+		tvec3<T> const & v1, 
+		tvec3<T> const & v2
+	)
+	{
+		return (v1.x != v2.x) || (v1.y != v2.y) || (v1.z != v2.z);
+	}
+
+	//////////////////////////////////////
+	// Unary bit operators
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator%=
+	(
+		U const & s
+	)
+	{
+		this->x %= s;
+		this->y %= s;
+		this->z %= s;
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator%=
+	(
+		tvec3<U> const & v
+	)
+	{
+		this->x %= v.x;
+		this->y %= v.y;
+		this->z %= v.z;
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator&=
+	(	
+		U const & s
+	)
+	{
+		this->x &= s;
+		this->y &= s;
+		this->z &= s;
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator&=
+	(
+		tvec3<U> const & v
+	)
+	{
+		this->x &= v.x;
+		this->y &= v.y;
+		this->z &= v.z;
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator|=
+	(
+		U const & s
+	)
+	{
+		this->x |= s;
+		this->y |= s;
+		this->z |= s;
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator|=
+	(
+		tvec3<U> const & v
+	)
+	{
+		this->x |= v.x;
+		this->y |= v.y;
+		this->z |= v.z;
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator^=
+	(
+		U const & s
+	)
+	{
+		this->x ^= s;
+		this->y ^= s;
+		this->z ^= s;
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator^=
+	(
+		tvec3<U> const & v
+	)
+	{
+		this->x ^= v.x;
+		this->y ^= v.y;
+		this->z ^= v.z;
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator<<=
+	(
+		U const & s
+	)
+	{
+		this->x <<= s;
+		this->y <<= s;
+		this->z <<= s;
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator<<=
+	(
+		tvec3<U> const & v
+	)
+	{
+		this->x <<= T(v.x);
+		this->y <<= T(v.y);
+		this->z <<= T(v.z);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator>>=
+	(
+		U const & s
+	)
+	{
+		this->x >>= T(s);
+		this->y >>= T(s);
+		this->z >>= T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec3<T> & tvec3<T>::operator>>=
+	(
+		tvec3<U> const & v
+	)
+	{
+		this->x >>= T(v.x);
+		this->y >>= T(v.y);
+		this->z >>= T(v.z);
+		return *this;
+	}
+
+	//////////////////////////////////////
+	// Swizzle operators
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER typename tvec3<T>::value_type 
+	tvec3<T>::swizzle
+	(
+		comp x
+	) const
+	{
+		return (*this)[x];
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> tvec3<T>::swizzle
+	(
+		comp x, 
+		comp y
+	) const
+	{
+		return tvec2<T>(
+			(*this)[x],
+			(*this)[y]);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> tvec3<T>::swizzle
+	(
+		comp x, 
+		comp y, 
+		comp z
+	) const
+	{
+		return tvec3<T>(
+			(*this)[x],
+			(*this)[y],
+			(*this)[z]);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> tvec3<T>::swizzle
+	(
+		comp x, 
+		comp y, 
+		comp z, 
+		comp w
+	) const
+	{
+		return tvec4<T>(
+			(*this)[x],
+			(*this)[y],
+			(*this)[z],
+			(*this)[w]);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tref3<T> tvec3<T>::swizzle
+	(
+		comp x, 
+		comp y, 
+		comp z
+	)
+	{
+		return tref3<T>(
+			(*this)[x],
+			(*this)[y],
+			(*this)[z]);
+	}
+
+	//////////////////////////////////////
+	// Binary arithmetic operators
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec3<T> operator+
+	(
+		tvec3<T> const & v, 
+		T const & s
+	)
+	{
+		return tvec3<T>(
+			v.x + T(s),
+			v.y + T(s),
+			v.z + T(s));
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec3<T> operator+ 
+	(
+		T const & s, 
+		tvec3<T> const & v
+	)
+	{
+		return tvec3<T>(
+			T(s) + v.x,
+			T(s) + v.y,
+			T(s) + v.z);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec3<T> operator+ 
+	(
+		tvec3<T> const & v1, 
+		tvec3<T> const & v2
+	)
+	{
+		return tvec3<T>(
+			v1.x + T(v2.x),
+			v1.y + T(v2.y),
+			v1.z + T(v2.z));
+	}
+
+	//operator-
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec3<T> operator- 
+	(
+		tvec3<T> const & v, 
+		T const & s
+	)
+	{
+		return tvec3<T>(
+			v.x - T(s),
+			v.y - T(s),
+			v.z - T(s));
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec3<T> operator- 
+	(
+		T const & s, 
+		tvec3<T> const & v
+	)
+	{
+		return tvec3<T>(
+			T(s) - v.x,
+			T(s) - v.y,
+			T(s) - v.z);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec3<T> operator- 
+	(
+		tvec3<T> const & v1, 
+		tvec3<T> const & v2
+	)
+	{
+		return tvec3<T>(
+			v1.x - T(v2.x),
+			v1.y - T(v2.y),
+			v1.z - T(v2.z));
+	}
+
+	//operator*
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec3<T> operator*
+	(
+		tvec3<T> const & v, 
+		T const & s
+	)
+	{
+		return tvec3<T>(
+			v.x * T(s),
+			v.y * T(s),
+			v.z * T(s));
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec3<T> operator* 
+	(
+		T const & s, 
+		tvec3<T> const & v
+	)
+	{
+		return tvec3<T>(
+			T(s) * v.x,
+			T(s) * v.y,
+			T(s) * v.z);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec3<T> operator* 
+	(
+		tvec3<T> const & v1, 
+		tvec3<T> const & v2
+	)
+	{
+		return tvec3<T>(
+			v1.x * T(v2.x),
+			v1.y * T(v2.y),
+			v1.z * T(v2.z));
+	}
+
+	//operator/
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec3<T> operator/
+	(
+		tvec3<T> const & v, 
+		T const & s
+	)
+	{
+		return tvec3<T>(
+			v.x / T(s),
+			v.y / T(s),
+			v.z / T(s));
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec3<T> operator/ 
+	(
+		T const & s, 
+		tvec3<T> const & v
+	)
+	{
+		return tvec3<T>(
+			T(s) / v.x,
+			T(s) / v.y,
+			T(s) / v.z);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec3<T> operator/ 
+	(
+		tvec3<T> const & v1, 
+		tvec3<T> const & v2
+	)
+	{
+		return tvec3<T>(
+			v1.x / T(v2.x),
+			v1.y / T(v2.y),
+			v1.z / T(v2.z));
+	}
+
+	// Unary constant operators
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec3<T> operator- 
+	(
+		tvec3<T> const & v
+	)
+	{
+		return tvec3<T>(
+			-v.x, 
+			-v.y, 
+			-v.z);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec3<T> operator++ 
+	(
+		tvec3<T> const & v, 
+		int
+	)
+	{
+		return tvec3<T>(
+			v.x + T(1), 
+			v.y + T(1), 
+			v.z + T(1));
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec3<T> operator-- 
+	(
+		tvec3<T> const & v, 
+		int
+	)
+	{
+		return tvec3<T>(
+			v.x - T(1), 
+			v.y - T(1), 
+			v.z - T(1));
+	}
+
+	//////////////////////////////////////
+	// Binary bit operators
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> operator% 
+	(
+		tvec3<T> const & v, 
+		T const & s
+	)
+	{
+		return tvec3<T>(
+			v.x % T(s),
+			v.y % T(s),
+			v.z % T(s));
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> operator%
+	(
+		T const & s, 
+		tvec3<T> const & v
+	)
+	{
+		return tvec3<T>(
+			T(s) % v.x,
+			T(s) % v.y,
+			T(s) % v.z);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> operator% 
+	(
+		tvec3<T> const & v1, 
+		tvec3<T> const & v2
+	)
+	{
+		return tvec3<T>(
+			v1.x % T(v2.x),
+			v1.y % T(v2.y),
+			v1.z % T(v2.z));
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> operator& 
+	(
+		tvec3<T> const & v, 
+		T const & s
+	)
+	{
+		return tvec3<T>(
+			v.x & T(s),
+			v.y & T(s),
+			v.z & T(s));
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> operator& 
+	(
+		T const & s, 
+		tvec3<T> const & v
+	)
+	{
+		return tvec3<T>(
+			T(s) & v.x,
+			T(s) & v.y,
+			T(s) & v.z);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> operator& 
+	(
+		tvec3<T> const & v1, 
+		tvec3<T> const & v2
+	)
+	{
+		return tvec3<T>(
+			v1.x & T(v2.x),
+			v1.y & T(v2.y),
+			v1.z & T(v2.z));
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> operator| 
+	(
+		tvec3<T> const & v, 
+		T const & s
+	)
+	{
+		return tvec3<T>(
+			v.x | T(s),
+			v.y | T(s),
+			v.z | T(s));
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> operator| 
+	(
+		T const & s, 
+		tvec3<T> const & v
+	)
+	{
+		return tvec3<T>(
+			T(s) | v.x,
+			T(s) | v.y,
+			T(s) | v.z);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> operator| 
+	(
+		tvec3<T> const & v1, 
+		tvec3<T> const & v2
+	)
+	{
+		return tvec3<T>(
+			v1.x | T(v2.x),
+			v1.y | T(v2.y),
+			v1.z | T(v2.z));
+	}
 		
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> operator^ 
-		(
-			tvec3<T> const & v, 
-			T const & s
-		)
-		{
-			return tvec3<T>(
-				v.x ^ T(s),
-				v.y ^ T(s),
-				v.z ^ T(s));
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> operator^ 
-		(
-			T const & s, 
-			tvec3<T> const & v
-		)
-		{
-			return tvec3<T>(
-				T(s) ^ v.x,
-				T(s) ^ v.y,
-				T(s) ^ v.z);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> operator^ 
-		(
-			tvec3<T> const & v1, 
-			tvec3<T> const & v2
-		)
-		{
-			return tvec3<T>(
-				v1.x ^ T(v2.x),
-				v1.y ^ T(v2.y),
-				v1.z ^ T(v2.z));
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> operator<< 
-		(
-			tvec3<T> const & v, 
-			T const & s
-		)
-		{
-			return tvec3<T>(
-				v.x << T(s),
-				v.y << T(s),
-				v.z << T(s));
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> operator<< 
-		(
-			T const & s, 
-			tvec3<T> const & v
-		)
-		{
-			return tvec3<T>(
-				T(s) << v.x,
-				T(s) << v.y,
-				T(s) << v.z);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> operator<< 
-		(
-			tvec3<T> const & v1, 
-			tvec3<T> const & v2
-		)
-		{
-			return tvec3<T>(
-				v1.x << T(v2.x),
-				v1.y << T(v2.y),
-				v1.z << T(v2.z));
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> operator>> 
-		(
-			tvec3<T> const & v, 
-			T const & s
-		)
-		{
-			return tvec3<T>(
-				v.x >> T(s),
-				v.y >> T(s),
-				v.z >> T(s));
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> operator>> 
-		(
-			T const & s, 
-			tvec3<T> const & v
-		)
-		{
-			return tvec3<T>(
-				s >> T(v.x),
-				s >> T(v.y),
-				s >> T(v.z));
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> operator>> 
-		(
-			tvec3<T> const & v1, 
-			tvec3<T> const & v2
-		)
-		{
-			return tvec3<T>(
-				v1.x >> T(v2.x),
-				v1.y >> T(v2.y),
-				v1.z >> T(v2.z));
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec3<T> operator~ 
-		(
-			tvec3<T> const & v
-		)
-		{
-			return tvec3<T>(
-				~v.x,
-				~v.y,
-				~v.z);
-		}
-
-		//////////////////////////////////////
-		// tref definition
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tref3<T>::tref3(T & x, T & y, T & z) :
-			x(x),
-			y(y),
-			z(z)
-		{}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tref3<T>::tref3
-		(
-			tref3<T> const & r
-		) :
-			x(r.x),
-			y(r.y),
-			z(r.z)
-		{}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tref3<T>::tref3
-		(
-			tvec3<T> const & v
-		) :
-			x(v.x),
-			y(v.y),
-			z(v.z)
-		{}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tref3<T> & tref3<T>::operator=
-		(
-			tref3<T> const & r
-		)
-		{
-			x = r.x;
-			y = r.y;
-			z = r.z;
-			return *this;
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tref3<T> & tref3<T>::operator=
-		(
-			tvec3<T> const & v
-		)
-		{
-			x = v.x;
-			y = v.y;
-			z = v.z;
-			return *this;
-		}
-
-	}//namespace detail
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> operator^ 
+	(
+		tvec3<T> const & v, 
+		T const & s
+	)
+	{
+		return tvec3<T>(
+			v.x ^ T(s),
+			v.y ^ T(s),
+			v.z ^ T(s));
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> operator^ 
+	(
+		T const & s, 
+		tvec3<T> const & v
+	)
+	{
+		return tvec3<T>(
+			T(s) ^ v.x,
+			T(s) ^ v.y,
+			T(s) ^ v.z);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> operator^ 
+	(
+		tvec3<T> const & v1, 
+		tvec3<T> const & v2
+	)
+	{
+		return tvec3<T>(
+			v1.x ^ T(v2.x),
+			v1.y ^ T(v2.y),
+			v1.z ^ T(v2.z));
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> operator<< 
+	(
+		tvec3<T> const & v, 
+		T const & s
+	)
+	{
+		return tvec3<T>(
+			v.x << T(s),
+			v.y << T(s),
+			v.z << T(s));
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> operator<< 
+	(
+		T const & s, 
+		tvec3<T> const & v
+	)
+	{
+		return tvec3<T>(
+			T(s) << v.x,
+			T(s) << v.y,
+			T(s) << v.z);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> operator<< 
+	(
+		tvec3<T> const & v1, 
+		tvec3<T> const & v2
+	)
+	{
+		return tvec3<T>(
+			v1.x << T(v2.x),
+			v1.y << T(v2.y),
+			v1.z << T(v2.z));
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> operator>> 
+	(
+		tvec3<T> const & v, 
+		T const & s
+	)
+	{
+		return tvec3<T>(
+			v.x >> T(s),
+			v.y >> T(s),
+			v.z >> T(s));
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> operator>> 
+	(
+		T const & s, 
+		tvec3<T> const & v
+	)
+	{
+		return tvec3<T>(
+			s >> T(v.x),
+			s >> T(v.y),
+			s >> T(v.z));
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> operator>> 
+	(
+		tvec3<T> const & v1, 
+		tvec3<T> const & v2
+	)
+	{
+		return tvec3<T>(
+			v1.x >> T(v2.x),
+			v1.y >> T(v2.y),
+			v1.z >> T(v2.z));
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec3<T> operator~ 
+	(
+		tvec3<T> const & v
+	)
+	{
+		return tvec3<T>(
+			~v.x,
+			~v.y,
+			~v.z);
+	}
+
+	//////////////////////////////////////
+	// tref definition
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tref3<T>::tref3(T & x, T & y, T & z) :
+		x(x),
+		y(y),
+		z(z)
+	{}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tref3<T>::tref3
+	(
+		tref3<T> const & r
+	) :
+		x(r.x),
+		y(r.y),
+		z(r.z)
+	{}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tref3<T>::tref3
+	(
+		tvec3<T> const & v
+	) :
+		x(v.x),
+		y(v.y),
+		z(v.z)
+	{}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tref3<T> & tref3<T>::operator=
+	(
+		tref3<T> const & r
+	)
+	{
+		x = r.x;
+		y = r.y;
+		z = r.z;
+		return *this;
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tref3<T> & tref3<T>::operator=
+	(
+		tvec3<T> const & v
+	)
+	{
+		x = v.x;
+		y = v.y;
+		z = v.z;
+		return *this;
+	}
+
+}//namespace detail
 }//namespace glm

+ 1213 - 1214
glm/core/type_vec4.inl

@@ -7,1221 +7,1220 @@
 // File    : glm/core/type_tvec4.inl
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-namespace glm
+namespace glm{
+namespace detail
 {
-	namespace detail
-	{
-		template <typename T>
-		GLM_FUNC_QUALIFIER typename tvec4<T>::size_type tvec4<T>::length() const
-		{
-			return 4;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER typename tvec4<T>::size_type tvec4<T>::value_size()
-		{
-			return 4;
-		}
-
-		//////////////////////////////////////
-		// Accesses
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER typename tvec4<T>::value_type & 
-		tvec4<T>::operator[]
-		(
-			size_type i
-		)
-		{
-			assert(i < value_size());
-			return (&x)[i];
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER typename tvec4<T>::value_type const & 
-		tvec4<T>::operator[]
-		(
-			size_type i
-		) const
-		{
-			assert(i < value_size());
-			return (&x)[i];
-		}
-
-		//////////////////////////////////////
-		// Implicit basic constructors
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T>::tvec4() :
-			x(value_type(0)),
-			y(value_type(0)),
-			z(value_type(0)),
-			w(value_type(0))
-		{}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec4<T>::tvec4
-		(
-			ctor
-		)
-		{}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T>::tvec4
-		(
-			type const & v
-		) :
-			x(v.x),
-			y(v.y),
-			z(v.z),
-			w(v.w)
-		{}
-
-		//////////////////////////////////////
-		// Explicit basic constructors
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T>::tvec4
-		(
-			value_type const & s
-		) :
-			x(s),
-			y(s),
-			z(s),
-			w(s)
-		{}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T>::tvec4
-		(
-			value_type const & s1, 
-			value_type const & s2, 
-			value_type const & s3, 
-			value_type const & s4
-		) :
-			x(s1),
-			y(s2),
-			z(s3),
-			w(s4)
-		{}
-
-		//////////////////////////////////////
-		// Swizzle constructors
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T>::tvec4
-		(
-			tref4<T> const & r
-		) :
-			x(r.x),
-			y(r.y),
-			z(r.z),
-			w(r.w)
-		{}
-
-		//////////////////////////////////////
-		// Convertion scalar constructors
+	template <typename T>
+	GLM_FUNC_QUALIFIER typename tvec4<T>::size_type tvec4<T>::length() const
+	{
+		return 4;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER typename tvec4<T>::size_type tvec4<T>::value_size()
+	{
+		return 4;
+	}
+
+	//////////////////////////////////////
+	// Accesses
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER typename tvec4<T>::value_type & 
+	tvec4<T>::operator[]
+	(
+		size_type i
+	)
+	{
+		assert(i < value_size());
+		return (&x)[i];
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER typename tvec4<T>::value_type const & 
+	tvec4<T>::operator[]
+	(
+		size_type i
+	) const
+	{
+		assert(i < value_size());
+		return (&x)[i];
+	}
+
+	//////////////////////////////////////
+	// Implicit basic constructors
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T>::tvec4() :
+		x(value_type(0)),
+		y(value_type(0)),
+		z(value_type(0)),
+		w(value_type(0))
+	{}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec4<T>::tvec4
+	(
+		ctor
+	)
+	{}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T>::tvec4
+	(
+		type const & v
+	) :
+		x(v.x),
+		y(v.y),
+		z(v.z),
+		w(v.w)
+	{}
+
+	//////////////////////////////////////
+	// Explicit basic constructors
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T>::tvec4
+	(
+		value_type const & s
+	) :
+		x(s),
+		y(s),
+		z(s),
+		w(s)
+	{}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T>::tvec4
+	(
+		value_type const & s1, 
+		value_type const & s2, 
+		value_type const & s3, 
+		value_type const & s4
+	) :
+		x(s1),
+		y(s2),
+		z(s3),
+		w(s4)
+	{}
+
+	//////////////////////////////////////
+	// Swizzle constructors
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T>::tvec4
+	(
+		tref4<T> const & r
+	) :
+		x(r.x),
+		y(r.y),
+		z(r.z),
+		w(r.w)
+	{}
+
+	//////////////////////////////////////
+	// Convertion scalar constructors
 		
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec4<T>::tvec4
-		(
-			U const & x
-		) :
-			x(value_type(x)),
-			y(value_type(x)),
-			z(value_type(x)),
-			w(value_type(x))
-		{}
-
-		template <typename T>
-		template <typename A, typename B, typename C, typename D> 
-		GLM_FUNC_QUALIFIER tvec4<T>::tvec4
-		(
-			A const & x, 
-			B const & y, 
-			C const & z, 
-			D const & w
-		) :
-			x(value_type(x)),
-			y(value_type(y)),
-			z(value_type(z)),
-			w(value_type(w))
-		{}
-
-		//////////////////////////////////////
-		// Convertion vector constructors
-
-		template <typename T>
-		template <typename A, typename B, typename C> 
-		GLM_FUNC_QUALIFIER tvec4<T>::tvec4
-		(
-			tvec2<A> const & v, 
-			B const & s1, 
-			C const & s2
-		) :
-			x(value_type(v.x)),
-			y(value_type(v.y)),
-			z(value_type(s1)),
-			w(value_type(s2))
-		{}
-
-		template <typename T>
-		template <typename A, typename B, typename C> 
-		GLM_FUNC_QUALIFIER tvec4<T>::tvec4
-		(
-			A const & s1, 
-			tvec2<B> const & v, 
-			C const & s2
-		) :
-			x(value_type(s1)),
-			y(value_type(v.x)),
-			z(value_type(v.y)),
-			w(value_type(s2))
-		{}
-
-		template <typename T>
-		template <typename A, typename B, typename C> 
-		GLM_FUNC_QUALIFIER tvec4<T>::tvec4
-		(
-			A const & s1, 
-			B const & s2, 
-			tvec2<C> const & v
-		) :
-			x(value_type(s1)),
-			y(value_type(s2)),
-			z(value_type(v.x)),
-			w(value_type(v.y))
-		{}
-
-		template <typename T>
-		template <typename A, typename B> 
-		GLM_FUNC_QUALIFIER tvec4<T>::tvec4
-		(
-			tvec3<A> const & v, 
-			B const & s
-		) :
-			x(value_type(v.x)),
-			y(value_type(v.y)),
-			z(value_type(v.z)),
-			w(value_type(s))
-		{}
-
-		template <typename T>
-		template <typename A, typename B> 
-		GLM_FUNC_QUALIFIER tvec4<T>::tvec4
-		(
-			A const & s, 
-			tvec3<B> const & v
-		) :
-			x(value_type(s)),
-			y(value_type(v.x)),
-			z(value_type(v.y)),
-			w(value_type(v.z))
-		{}
-
-		template <typename T>
-		template <typename A, typename B> 
-		GLM_FUNC_QUALIFIER tvec4<T>::tvec4
-		(
-			tvec2<A> const & v1, 
-			tvec2<B> const & v2
-		) :
-			x(value_type(v1.x)),
-			y(value_type(v1.y)),
-			z(value_type(v2.x)),
-			w(value_type(v2.y))
-		{}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec4<T>::tvec4
-		(
-			tvec4<U> const & v
-		) :
-			x(value_type(v.x)),
-			y(value_type(v.y)),
-			z(value_type(v.z)),
-			w(value_type(v.w))
-		{}
-
-		//////////////////////////////////////
-		// Unary arithmetic operators
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator= 
-		(
-			tvec4<T> const & v
-		)
-		{
-			this->x = v.x;
-			this->y = v.y;
-			this->z = v.z;
-			this->w = v.w;
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator= 
-		(
-			tvec4<U> const & v
-		)
-		{
-			this->x = T(v.x);
-			this->y = T(v.y);
-			this->z = T(v.z);
-			this->w = T(v.w);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator+=
-		(
-			U const & s
-		)
-		{
-			this->x += T(s);
-			this->y += T(s);
-			this->z += T(s);
-			this->w += T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator+=
-		(
-			tvec4<U> const & v
-		)
-		{
-			this->x += T(v.x);
-			this->y += T(v.y);
-			this->z += T(v.z);
-			this->w += T(v.w);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator-=
-		(
-			U const & s
-		)
-		{
-			this->x -= T(s);
-			this->y -= T(s);
-			this->z -= T(s);
-			this->w -= T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator-=
-		(
-			tvec4<U> const & v
-		)
-		{
-			this->x -= T(v.x);
-			this->y -= T(v.y);
-			this->z -= T(v.z);
-			this->w -= T(v.w);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator*=
-		(
-			U const & s
-		)
-		{
-			this->x *= T(s);
-			this->y *= T(s);
-			this->z *= T(s);
-			this->w *= T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator*=
-		(
-			tvec4<U> const & v
-		)
-		{
-			this->x *= T(v.x);
-			this->y *= T(v.y);
-			this->z *= T(v.z);
-			this->w *= T(v.w);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator/=
-		(
-			U const & s
-		)
-		{
-			this->x /= T(s);
-			this->y /= T(s);
-			this->z /= T(s);
-			this->w /= T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator/=
-		(
-			tvec4<U> const & v
-		)
-		{
-			this->x /= T(v.x);
-			this->y /= T(v.y);
-			this->z /= T(v.z);
-			this->w /= T(v.w);
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator++()
-		{
-			++this->x;
-			++this->y;
-			++this->z;
-			++this->w;
-			return *this;
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator--()
-		{
-			--this->x;
-			--this->y;
-			--this->z;
-			--this->w;
-			return *this;
-		}
-
-		//////////////////////////////////////
-		// Unary bit operators
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator%=
-		(
-			U const & s
-		)
-		{
-			this->x %= T(s);
-			this->y %= T(s);
-			this->z %= T(s);
-			this->w %= T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator%=
-		(
-			tvec4<U> const & v
-		)
-		{
-			this->x %= T(v.x);
-			this->y %= T(v.y);
-			this->z %= T(v.z);
-			this->w %= T(v.w);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator&=
-		(
-			U const & s
-		)
-		{
-			this->x &= T(s);
-			this->y &= T(s);
-			this->z &= T(s);
-			this->w &= T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator&=
-		(
-			tvec4<U> const & v
-		)
-		{
-			this->x &= T(v.x);
-			this->y &= T(v.y);
-			this->z &= T(v.z);
-			this->w &= T(v.w);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator|=
-		(
-			U const & s
-		)
-		{
-			this->x |= T(s);
-			this->y |= T(s);
-			this->z |= T(s);
-			this->w |= T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator|=
-		(
-			tvec4<U> const & v
-		)
-		{
-			this->x |= T(v.x);
-			this->y |= T(v.y);
-			this->z |= T(v.z);
-			this->w |= T(v.w);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator^=
-		(
-			U const & s
-		)
-		{
-			this->x ^= T(s);
-			this->y ^= T(s);
-			this->z ^= T(s);
-			this->w ^= T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator^=
-		(
-			tvec4<U> const & v
-		)
-		{
-			this->x ^= T(v.x);
-			this->y ^= T(v.y);
-			this->z ^= T(v.z);
-			this->w ^= T(v.w);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator<<=
-		(
-			U const & s
-		)
-		{
-			this->x <<= T(s);
-			this->y <<= T(s);
-			this->z <<= T(s);
-			this->w <<= T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator<<=
-		(
-			tvec4<U> const & v
-		)
-		{
-			this->x <<= T(v.x);
-			this->y <<= T(v.y);
-			this->z <<= T(v.z);
-			this->w <<= T(v.w);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator>>=
-		(
-			U const & s
-		)
-		{
-			this->x >>= T(s);
-			this->y >>= T(s);
-			this->z >>= T(s);
-			this->w >>= T(s);
-			return *this;
-		}
-
-		template <typename T>
-		template <typename U> 
-		GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator>>=
-		(
-			tvec4<U> const & v
-		)
-		{
-			this->x >>= T(v.x);
-			this->y >>= T(v.y);
-			this->z >>= T(v.z);
-			this->w >>= T(v.w);
-			return *this;
-		}
-
-		//////////////////////////////////////
-		// Swizzle operators
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER typename tvec4<T>::value_type 
-		tvec4<T>::swizzle
-		(	
-			comp x
-		) const
-		{
-			return (*this)[x];
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec2<T> tvec4<T>::swizzle
-		(
-			comp x, 
-			comp y
-		) const
-		{
-			return tvec2<T>(
-				(*this)[x],
-				(*this)[y]);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec3<T> tvec4<T>::swizzle
-		(
-			comp x, 
-			comp y, 
-			comp z
-		) const
-		{
-			return tvec3<T>(
-				(*this)[x],
-				(*this)[y],
-				(*this)[z]);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> tvec4<T>::swizzle
-		(
-			comp x, 
-			comp y, 
-			comp z, 
-			comp w
-		) const
-		{
-			return tvec4<T>(
-				(*this)[x],
-				(*this)[y],
-				(*this)[z],
-				(*this)[w]);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tref4<T> tvec4<T>::swizzle
-		(
-			comp x, 
-			comp y, 
-			comp z, 
-			comp w
-		)
-		{
-			return tref4<T>(
-				(*this)[x],
-				(*this)[y],
-				(*this)[z],
-				(*this)[w]);
-		}
-
-		//////////////////////////////////////
-		// Binary arithmetic operators
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec4<T> operator+ 
-		(
-			tvec4<T> const & v, 
-			typename tvec4<T>::value_type const & s
-		)
-		{
-			return tvec4<T>(
-				v.x + s,
-				v.y + s,
-				v.z + s,
-				v.w + s);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec4<T> operator+ 
-		(
-			typename tvec4<T>::value_type const & s, 
-			tvec4<T> const & v
-		)
-		{
-			return tvec4<T>(
-				s + v.x,
-				s + v.y,
-				s + v.z,
-				s + v.w);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec4<T> operator+ 
-		(
-			tvec4<T> const & v1, 
-			tvec4<T> const & v2
-		)
-		{
-			return tvec4<T>(
-				v1.x + v2.x,
-				v1.y + v2.y,
-				v1.z + v2.z,
-				v1.w + v2.w);
-		}
-
-		//operator-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec4<T> operator- 
-		(
-			tvec4<T> const & v, 
-			typename tvec4<T>::value_type const & s
-		)
-		{
-			return tvec4<T>(
-				v.x - s,
-				v.y - s,
-				v.z - s,
-				v.w - s);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec4<T> operator- 
-		(
-			typename tvec4<T>::value_type const & s, 
-			tvec4<T> const & v
-		)
-		{
-			return tvec4<T>(
-				s - v.x,
-				s - v.y,
-				s - v.z,
-				s - v.w);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec4<T> operator- 
-		(
-			tvec4<T> const & v1, 
-			tvec4<T> const & v2
-		)
-		{
-			return tvec4<T>(
-				v1.x - v2.x,
-				v1.y - v2.y,
-				v1.z - v2.z,
-				v1.w - v2.w);
-		}
-
-		//operator*
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec4<T> operator* 
-		(
-			tvec4<T> const & v, 
-			typename tvec4<T>::value_type const & s
-		)
-		{
-			return tvec4<T>(
-				v.x * s,
-				v.y * s,
-				v.z * s,
-				v.w * s);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec4<T> operator* 
-		(
-			typename tvec4<T>::value_type const & s, 
-			tvec4<T> const & v
-		)
-		{
-			return tvec4<T>(
-				s * v.x,
-				s * v.y,
-				s * v.z,
-				s * v.w);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec4<T> operator*
-		(
-			tvec4<T> const & v1, 
-			tvec4<T> const & v2
-		)
-		{
-			return tvec4<T>(
-				v1.x * v2.x,
-				v1.y * v2.y,
-				v1.z * v2.z,
-				v1.w * v2.w);
-		}
-
-		//operator/
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec4<T> operator/ 
-		(
-			tvec4<T> const & v, 
-			typename tvec4<T>::value_type const & s
-		)
-		{
-			return tvec4<T>(
-				v.x / s,
-				v.y / s,
-				v.z / s,
-				v.w / s);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec4<T> operator/ 
-		(
-			typename tvec4<T>::value_type const & s, 
-			tvec4<T> const & v
-		)
-		{
-			return tvec4<T>(
-				s / v.x,
-				s / v.y,
-				s / v.z,
-				s / v.w);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec4<T> operator/ 
-		(
-			tvec4<T> const & v1, 
-			tvec4<T> const & v2
-		)
-		{
-			return tvec4<T>(
-				v1.x / v2.x,
-				v1.y / v2.y,
-				v1.z / v2.z,
-				v1.w / v2.w);
-		}
-
-		// Unary constant operators
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec4<T> operator- 
-		(
-			tvec4<T> const & v
-		)
-		{
-			return tvec4<T>(
-				-v.x, 
-				-v.y, 
-				-v.z, 
-				-v.w);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec4<T> operator++ 
-		(
-			tvec4<T> const & v, 
-			int
-		)
-		{
-			typename tvec4<T>::value_type One(1);
-			return tvec4<T>(
-				v.x + One, 
-				v.y + One, 
-				v.z + One, 
-				v.w + One);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec4<T> operator-- 
-		(
-			tvec4<T> const & v, 
-			int
-		)
-		{
-			typename tvec4<T>::value_type One(1);
-			return tvec4<T>(
-				v.x - One, 
-				v.y - One, 
-				v.z - One, 
-				v.w - One);
-		}
-
-		//////////////////////////////////////
-		// Boolean operators
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER bool operator==
-		(
-			tvec4<T> const & v1, 
-			tvec4<T> const & v2
-		)
-		{
-			return (v1.x == v2.x) && (v1.y == v2.y) && (v1.z == v2.z) && (v1.w == v2.w);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER bool operator!=
-		(
-			tvec4<T> const & v1, 
-			tvec4<T> const & v2
-		)
-		{
-			return (v1.x != v2.x) || (v1.y != v2.y) || (v1.z != v2.z) || (v1.w != v2.w);
-		}
-
-		//////////////////////////////////////
-		// Binary bit operators
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> operator% 
-		(
-			tvec4<T> const & v, 
-			typename tvec4<T>::value_type const & s
-		)
-		{
-			return tvec4<T>(
-				v.x % s,
-				v.y % s,
-				v.z % s,
-				v.w % s);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> operator% 
-		(
-			typename tvec4<T>::value_type const & s, 
-			tvec4<T> const & v
-		)
-		{
-			return tvec4<T>(
-				s % v.x,
-				s % v.y,
-				s % v.z,
-				s % v.w);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> operator%
-		(
-			tvec4<T> const & v1, 
-			tvec4<T> const & v2
-		)
-		{
-			return tvec4<T>(
-				v1.x % v2.x,
-				v1.y % v2.y,
-				v1.z % v2.z,
-				v1.w % v2.w);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> operator& 
-		(
-			tvec4<T> const & v, 
-			typename tvec4<T>::value_type const & s
-		)
-		{
-			return tvec4<T>(
-				v.x & s,
-				v.y & s,
-				v.z & s,
-				v.w & s);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> operator& 
-		(
-			typename tvec4<T>::value_type const & s, 
-			tvec4<T> const & v
-		)
-		{
-			return tvec4<T>(
-				s & v.x,
-				s & v.y,
-				s & v.z,
-				s & v.w);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> operator&
-		(
-			tvec4<T> const & v1,
-			tvec4<T> const & v2
-		)
-		{
-			return tvec4<T>(
-				v1.x & v2.x,
-				v1.y & v2.y,
-				v1.z & v2.z,
-				v1.w & v2.w);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> operator|
-		(
-			tvec4<T> const & v, 
-			typename tvec4<T>::value_type const & s
-		)
-		{
-			return tvec4<T>(
-				v.x | s,
-				v.y | s,
-				v.z | s,
-				v.w | s);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> operator|
-		(
-			typename tvec4<T>::value_type const & s, 
-			tvec4<T> const & v
-		)
-		{
-			return tvec4<T>(
-				s | v.x,
-				s | v.y,
-				s | v.z,
-				s | v.w);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> operator|
-		(
-			tvec4<T> const & v1, 
-			tvec4<T> const & v2
-		)
-		{
-			return tvec4<T>(
-				v1.x | v2.x,
-				v1.y | v2.y,
-				v1.z | v2.z,
-				v1.w | v2.w);
-		}
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec4<T>::tvec4
+	(
+		U const & x
+	) :
+		x(value_type(x)),
+		y(value_type(x)),
+		z(value_type(x)),
+		w(value_type(x))
+	{}
+
+	template <typename T>
+	template <typename A, typename B, typename C, typename D> 
+	GLM_FUNC_QUALIFIER tvec4<T>::tvec4
+	(
+		A const & x, 
+		B const & y, 
+		C const & z, 
+		D const & w
+	) :
+		x(value_type(x)),
+		y(value_type(y)),
+		z(value_type(z)),
+		w(value_type(w))
+	{}
+
+	//////////////////////////////////////
+	// Convertion vector constructors
+
+	template <typename T>
+	template <typename A, typename B, typename C> 
+	GLM_FUNC_QUALIFIER tvec4<T>::tvec4
+	(
+		tvec2<A> const & v, 
+		B const & s1, 
+		C const & s2
+	) :
+		x(value_type(v.x)),
+		y(value_type(v.y)),
+		z(value_type(s1)),
+		w(value_type(s2))
+	{}
+
+	template <typename T>
+	template <typename A, typename B, typename C> 
+	GLM_FUNC_QUALIFIER tvec4<T>::tvec4
+	(
+		A const & s1, 
+		tvec2<B> const & v, 
+		C const & s2
+	) :
+		x(value_type(s1)),
+		y(value_type(v.x)),
+		z(value_type(v.y)),
+		w(value_type(s2))
+	{}
+
+	template <typename T>
+	template <typename A, typename B, typename C> 
+	GLM_FUNC_QUALIFIER tvec4<T>::tvec4
+	(
+		A const & s1, 
+		B const & s2, 
+		tvec2<C> const & v
+	) :
+		x(value_type(s1)),
+		y(value_type(s2)),
+		z(value_type(v.x)),
+		w(value_type(v.y))
+	{}
+
+	template <typename T>
+	template <typename A, typename B> 
+	GLM_FUNC_QUALIFIER tvec4<T>::tvec4
+	(
+		tvec3<A> const & v, 
+		B const & s
+	) :
+		x(value_type(v.x)),
+		y(value_type(v.y)),
+		z(value_type(v.z)),
+		w(value_type(s))
+	{}
+
+	template <typename T>
+	template <typename A, typename B> 
+	GLM_FUNC_QUALIFIER tvec4<T>::tvec4
+	(
+		A const & s, 
+		tvec3<B> const & v
+	) :
+		x(value_type(s)),
+		y(value_type(v.x)),
+		z(value_type(v.y)),
+		w(value_type(v.z))
+	{}
+
+	template <typename T>
+	template <typename A, typename B> 
+	GLM_FUNC_QUALIFIER tvec4<T>::tvec4
+	(
+		tvec2<A> const & v1, 
+		tvec2<B> const & v2
+	) :
+		x(value_type(v1.x)),
+		y(value_type(v1.y)),
+		z(value_type(v2.x)),
+		w(value_type(v2.y))
+	{}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec4<T>::tvec4
+	(
+		tvec4<U> const & v
+	) :
+		x(value_type(v.x)),
+		y(value_type(v.y)),
+		z(value_type(v.z)),
+		w(value_type(v.w))
+	{}
+
+	//////////////////////////////////////
+	// Unary arithmetic operators
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator= 
+	(
+		tvec4<T> const & v
+	)
+	{
+		this->x = v.x;
+		this->y = v.y;
+		this->z = v.z;
+		this->w = v.w;
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator= 
+	(
+		tvec4<U> const & v
+	)
+	{
+		this->x = T(v.x);
+		this->y = T(v.y);
+		this->z = T(v.z);
+		this->w = T(v.w);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator+=
+	(
+		U const & s
+	)
+	{
+		this->x += T(s);
+		this->y += T(s);
+		this->z += T(s);
+		this->w += T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator+=
+	(
+		tvec4<U> const & v
+	)
+	{
+		this->x += T(v.x);
+		this->y += T(v.y);
+		this->z += T(v.z);
+		this->w += T(v.w);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator-=
+	(
+		U const & s
+	)
+	{
+		this->x -= T(s);
+		this->y -= T(s);
+		this->z -= T(s);
+		this->w -= T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator-=
+	(
+		tvec4<U> const & v
+	)
+	{
+		this->x -= T(v.x);
+		this->y -= T(v.y);
+		this->z -= T(v.z);
+		this->w -= T(v.w);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator*=
+	(
+		U const & s
+	)
+	{
+		this->x *= T(s);
+		this->y *= T(s);
+		this->z *= T(s);
+		this->w *= T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator*=
+	(
+		tvec4<U> const & v
+	)
+	{
+		this->x *= T(v.x);
+		this->y *= T(v.y);
+		this->z *= T(v.z);
+		this->w *= T(v.w);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator/=
+	(
+		U const & s
+	)
+	{
+		this->x /= T(s);
+		this->y /= T(s);
+		this->z /= T(s);
+		this->w /= T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator/=
+	(
+		tvec4<U> const & v
+	)
+	{
+		this->x /= T(v.x);
+		this->y /= T(v.y);
+		this->z /= T(v.z);
+		this->w /= T(v.w);
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator++()
+	{
+		++this->x;
+		++this->y;
+		++this->z;
+		++this->w;
+		return *this;
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator--()
+	{
+		--this->x;
+		--this->y;
+		--this->z;
+		--this->w;
+		return *this;
+	}
+
+	//////////////////////////////////////
+	// Unary bit operators
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator%=
+	(
+		U const & s
+	)
+	{
+		this->x %= T(s);
+		this->y %= T(s);
+		this->z %= T(s);
+		this->w %= T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator%=
+	(
+		tvec4<U> const & v
+	)
+	{
+		this->x %= T(v.x);
+		this->y %= T(v.y);
+		this->z %= T(v.z);
+		this->w %= T(v.w);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator&=
+	(
+		U const & s
+	)
+	{
+		this->x &= T(s);
+		this->y &= T(s);
+		this->z &= T(s);
+		this->w &= T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator&=
+	(
+		tvec4<U> const & v
+	)
+	{
+		this->x &= T(v.x);
+		this->y &= T(v.y);
+		this->z &= T(v.z);
+		this->w &= T(v.w);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator|=
+	(
+		U const & s
+	)
+	{
+		this->x |= T(s);
+		this->y |= T(s);
+		this->z |= T(s);
+		this->w |= T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator|=
+	(
+		tvec4<U> const & v
+	)
+	{
+		this->x |= T(v.x);
+		this->y |= T(v.y);
+		this->z |= T(v.z);
+		this->w |= T(v.w);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator^=
+	(
+		U const & s
+	)
+	{
+		this->x ^= T(s);
+		this->y ^= T(s);
+		this->z ^= T(s);
+		this->w ^= T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator^=
+	(
+		tvec4<U> const & v
+	)
+	{
+		this->x ^= T(v.x);
+		this->y ^= T(v.y);
+		this->z ^= T(v.z);
+		this->w ^= T(v.w);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator<<=
+	(
+		U const & s
+	)
+	{
+		this->x <<= T(s);
+		this->y <<= T(s);
+		this->z <<= T(s);
+		this->w <<= T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator<<=
+	(
+		tvec4<U> const & v
+	)
+	{
+		this->x <<= T(v.x);
+		this->y <<= T(v.y);
+		this->z <<= T(v.z);
+		this->w <<= T(v.w);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator>>=
+	(
+		U const & s
+	)
+	{
+		this->x >>= T(s);
+		this->y >>= T(s);
+		this->z >>= T(s);
+		this->w >>= T(s);
+		return *this;
+	}
+
+	template <typename T>
+	template <typename U> 
+	GLM_FUNC_QUALIFIER tvec4<T> & tvec4<T>::operator>>=
+	(
+		tvec4<U> const & v
+	)
+	{
+		this->x >>= T(v.x);
+		this->y >>= T(v.y);
+		this->z >>= T(v.z);
+		this->w >>= T(v.w);
+		return *this;
+	}
+
+	//////////////////////////////////////
+	// Swizzle operators
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER typename tvec4<T>::value_type 
+	tvec4<T>::swizzle
+	(	
+		comp x
+	) const
+	{
+		return (*this)[x];
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec2<T> tvec4<T>::swizzle
+	(
+		comp x, 
+		comp y
+	) const
+	{
+		return tvec2<T>(
+			(*this)[x],
+			(*this)[y]);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec3<T> tvec4<T>::swizzle
+	(
+		comp x, 
+		comp y, 
+		comp z
+	) const
+	{
+		return tvec3<T>(
+			(*this)[x],
+			(*this)[y],
+			(*this)[z]);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> tvec4<T>::swizzle
+	(
+		comp x, 
+		comp y, 
+		comp z, 
+		comp w
+	) const
+	{
+		return tvec4<T>(
+			(*this)[x],
+			(*this)[y],
+			(*this)[z],
+			(*this)[w]);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tref4<T> tvec4<T>::swizzle
+	(
+		comp x, 
+		comp y, 
+		comp z, 
+		comp w
+	)
+	{
+		return tref4<T>(
+			(*this)[x],
+			(*this)[y],
+			(*this)[z],
+			(*this)[w]);
+	}
+
+	//////////////////////////////////////
+	// Binary arithmetic operators
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec4<T> operator+ 
+	(
+		tvec4<T> const & v, 
+		typename tvec4<T>::value_type const & s
+	)
+	{
+		return tvec4<T>(
+			v.x + s,
+			v.y + s,
+			v.z + s,
+			v.w + s);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec4<T> operator+ 
+	(
+		typename tvec4<T>::value_type const & s, 
+		tvec4<T> const & v
+	)
+	{
+		return tvec4<T>(
+			s + v.x,
+			s + v.y,
+			s + v.z,
+			s + v.w);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec4<T> operator+ 
+	(
+		tvec4<T> const & v1, 
+		tvec4<T> const & v2
+	)
+	{
+		return tvec4<T>(
+			v1.x + v2.x,
+			v1.y + v2.y,
+			v1.z + v2.z,
+			v1.w + v2.w);
+	}
+
+	//operator-
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec4<T> operator- 
+	(
+		tvec4<T> const & v, 
+		typename tvec4<T>::value_type const & s
+	)
+	{
+		return tvec4<T>(
+			v.x - s,
+			v.y - s,
+			v.z - s,
+			v.w - s);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec4<T> operator- 
+	(
+		typename tvec4<T>::value_type const & s, 
+		tvec4<T> const & v
+	)
+	{
+		return tvec4<T>(
+			s - v.x,
+			s - v.y,
+			s - v.z,
+			s - v.w);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec4<T> operator- 
+	(
+		tvec4<T> const & v1, 
+		tvec4<T> const & v2
+	)
+	{
+		return tvec4<T>(
+			v1.x - v2.x,
+			v1.y - v2.y,
+			v1.z - v2.z,
+			v1.w - v2.w);
+	}
+
+	//operator*
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec4<T> operator* 
+	(
+		tvec4<T> const & v, 
+		typename tvec4<T>::value_type const & s
+	)
+	{
+		return tvec4<T>(
+			v.x * s,
+			v.y * s,
+			v.z * s,
+			v.w * s);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec4<T> operator* 
+	(
+		typename tvec4<T>::value_type const & s, 
+		tvec4<T> const & v
+	)
+	{
+		return tvec4<T>(
+			s * v.x,
+			s * v.y,
+			s * v.z,
+			s * v.w);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec4<T> operator*
+	(
+		tvec4<T> const & v1, 
+		tvec4<T> const & v2
+	)
+	{
+		return tvec4<T>(
+			v1.x * v2.x,
+			v1.y * v2.y,
+			v1.z * v2.z,
+			v1.w * v2.w);
+	}
+
+	//operator/
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec4<T> operator/ 
+	(
+		tvec4<T> const & v, 
+		typename tvec4<T>::value_type const & s
+	)
+	{
+		return tvec4<T>(
+			v.x / s,
+			v.y / s,
+			v.z / s,
+			v.w / s);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec4<T> operator/ 
+	(
+		typename tvec4<T>::value_type const & s, 
+		tvec4<T> const & v
+	)
+	{
+		return tvec4<T>(
+			s / v.x,
+			s / v.y,
+			s / v.z,
+			s / v.w);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec4<T> operator/ 
+	(
+		tvec4<T> const & v1, 
+		tvec4<T> const & v2
+	)
+	{
+		return tvec4<T>(
+			v1.x / v2.x,
+			v1.y / v2.y,
+			v1.z / v2.z,
+			v1.w / v2.w);
+	}
+
+	// Unary constant operators
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec4<T> operator- 
+	(
+		tvec4<T> const & v
+	)
+	{
+		return tvec4<T>(
+			-v.x, 
+			-v.y, 
+			-v.z, 
+			-v.w);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec4<T> operator++ 
+	(
+		tvec4<T> const & v, 
+		int
+	)
+	{
+		typename tvec4<T>::value_type One(1);
+		return tvec4<T>(
+			v.x + One, 
+			v.y + One, 
+			v.z + One, 
+			v.w + One);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec4<T> operator-- 
+	(
+		tvec4<T> const & v, 
+		int
+	)
+	{
+		typename tvec4<T>::value_type One(1);
+		return tvec4<T>(
+			v.x - One, 
+			v.y - One, 
+			v.z - One, 
+			v.w - One);
+	}
+
+	//////////////////////////////////////
+	// Boolean operators
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER bool operator==
+	(
+		tvec4<T> const & v1, 
+		tvec4<T> const & v2
+	)
+	{
+		return (v1.x == v2.x) && (v1.y == v2.y) && (v1.z == v2.z) && (v1.w == v2.w);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER bool operator!=
+	(
+		tvec4<T> const & v1, 
+		tvec4<T> const & v2
+	)
+	{
+		return (v1.x != v2.x) || (v1.y != v2.y) || (v1.z != v2.z) || (v1.w != v2.w);
+	}
+
+	//////////////////////////////////////
+	// Binary bit operators
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> operator% 
+	(
+		tvec4<T> const & v, 
+		typename tvec4<T>::value_type const & s
+	)
+	{
+		return tvec4<T>(
+			v.x % s,
+			v.y % s,
+			v.z % s,
+			v.w % s);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> operator% 
+	(
+		typename tvec4<T>::value_type const & s, 
+		tvec4<T> const & v
+	)
+	{
+		return tvec4<T>(
+			s % v.x,
+			s % v.y,
+			s % v.z,
+			s % v.w);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> operator%
+	(
+		tvec4<T> const & v1, 
+		tvec4<T> const & v2
+	)
+	{
+		return tvec4<T>(
+			v1.x % v2.x,
+			v1.y % v2.y,
+			v1.z % v2.z,
+			v1.w % v2.w);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> operator& 
+	(
+		tvec4<T> const & v, 
+		typename tvec4<T>::value_type const & s
+	)
+	{
+		return tvec4<T>(
+			v.x & s,
+			v.y & s,
+			v.z & s,
+			v.w & s);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> operator& 
+	(
+		typename tvec4<T>::value_type const & s, 
+		tvec4<T> const & v
+	)
+	{
+		return tvec4<T>(
+			s & v.x,
+			s & v.y,
+			s & v.z,
+			s & v.w);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> operator&
+	(
+		tvec4<T> const & v1,
+		tvec4<T> const & v2
+	)
+	{
+		return tvec4<T>(
+			v1.x & v2.x,
+			v1.y & v2.y,
+			v1.z & v2.z,
+			v1.w & v2.w);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> operator|
+	(
+		tvec4<T> const & v, 
+		typename tvec4<T>::value_type const & s
+	)
+	{
+		return tvec4<T>(
+			v.x | s,
+			v.y | s,
+			v.z | s,
+			v.w | s);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> operator|
+	(
+		typename tvec4<T>::value_type const & s, 
+		tvec4<T> const & v
+	)
+	{
+		return tvec4<T>(
+			s | v.x,
+			s | v.y,
+			s | v.z,
+			s | v.w);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> operator|
+	(
+		tvec4<T> const & v1, 
+		tvec4<T> const & v2
+	)
+	{
+		return tvec4<T>(
+			v1.x | v2.x,
+			v1.y | v2.y,
+			v1.z | v2.z,
+			v1.w | v2.w);
+	}
 		
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> operator^
-		(
-			tvec4<T> const & v, 
-			typename tvec4<T>::value_type const & s
-		)
-		{
-			return tvec4<T>(
-				v.x ^ s,
-				v.y ^ s,
-				v.z ^ s,
-				v.w ^ s);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> operator^
-		(
-			typename tvec4<T>::value_type const & s, 
-			tvec4<T> const & v
-		)
-		{
-			return tvec4<T>(
-				s ^ v.x,
-				s ^ v.y,
-				s ^ v.z,
-				s ^ v.w);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> operator^
-		(
-			tvec4<T> const & v1,
-			tvec4<T> const & v2
-		)
-		{
-			return tvec4<T>(
-				v1.x ^ v2.x,
-				v1.y ^ v2.y,
-				v1.z ^ v2.z,
-				v1.w ^ v2.w);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> operator<<
-		(
-			tvec4<T> const & v,
-			typename tvec4<T>::value_type const & s
-		)
-		{
-			return tvec4<T>(
-				v.x << s,
-				v.y << s,
-				v.z << s,
-				v.w << s);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> operator<<
-		(
-			typename tvec4<T>::value_type const & s,
-			tvec4<T> const & v
-		)
-		{
-			return tvec4<T>(
-				s << v.x,
-				s << v.y,
-				s << v.z,
-				s << v.w);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> operator<<
-		(
-			tvec4<T> const & v1,
-			tvec4<T> const & v2
-		)
-		{
-			return tvec4<T>(
-				v1.x << v2.x,
-				v1.y << v2.y,
-				v1.z << v2.z,
-				v1.w << v2.w);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> operator>>
-		(
-			tvec4<T> const & v,
-			typename tvec4<T>::value_type const & s
-		)
-		{
-			return tvec4<T>(
-				v.x >> s,
-				v.y >> s,
-				v.z >> s,
-				v.w >> s);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> operator>>
-		(
-			typename tvec4<T>::value_type const & s,
-			tvec4<T> const & v
-		)
-		{
-			return tvec4<T>(
-				s >> v.x,
-				s >> v.y,
-				s >> v.z,
-				s >> v.w);
-		}
-
-		template <typename T>
-		GLM_FUNC_QUALIFIER tvec4<T> operator>>
-		(
-			tvec4<T> const & v1,
-			tvec4<T> const & v2
-		)
-		{
-			return tvec4<T>(
-				v1.x >> v2.x,
-				v1.y >> v2.y,
-				v1.z >> v2.z,
-				v1.w >> v2.w);
-		}
-
-		template <typename T> 
-		GLM_FUNC_QUALIFIER tvec4<T> operator~
-		(
-			tvec4<T> const & v
-		)
-		{
-			return tvec4<T>(
-				~v.x,
-				~v.y,
-				~v.z,
-				~v.w);
-		}
-
-		//////////////////////////////////////
-		// tref definition
-
-		template <typename T> 
-		tref4<T>::tref4
-		(
-			T & x, 
-			T & y, 
-			T & z, 
-			T & w
-		) :
-			x(x),
-			y(y),
-			z(z),
-			w(w)
-		{}
-
-		template <typename T> 
-		tref4<T>::tref4
-		(
-			tref4<T> const & r
-		) :
-			x(r.x),
-			y(r.y),
-			z(r.z),
-			w(r.w)
-		{}
-
-		template <typename T> 
-		tref4<T>::tref4
-		(
-			tvec4<T> const & v
-		) :
-			x(v.x),
-			y(v.y),
-			z(v.z),
-			w(v.w)
-		{}
-
-		template <typename T> 
-		tref4<T>& tref4<T>::operator= 
-		(
-			tref4<T> const & r
-		)
-		{
-			x = r.x;
-			y = r.y;
-			z = r.z;
-			w = r.w;
-			return *this;
-		}
-
-		template <typename T> 
-		tref4<T>& tref4<T>::operator= 
-		(
-			tvec4<T> const & v
-		)
-		{
-			x = v.x;
-			y = v.y;
-			z = v.z;
-			w = v.w;
-			return *this;
-		}
-
-	}//namespace detail
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> operator^
+	(
+		tvec4<T> const & v, 
+		typename tvec4<T>::value_type const & s
+	)
+	{
+		return tvec4<T>(
+			v.x ^ s,
+			v.y ^ s,
+			v.z ^ s,
+			v.w ^ s);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> operator^
+	(
+		typename tvec4<T>::value_type const & s, 
+		tvec4<T> const & v
+	)
+	{
+		return tvec4<T>(
+			s ^ v.x,
+			s ^ v.y,
+			s ^ v.z,
+			s ^ v.w);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> operator^
+	(
+		tvec4<T> const & v1,
+		tvec4<T> const & v2
+	)
+	{
+		return tvec4<T>(
+			v1.x ^ v2.x,
+			v1.y ^ v2.y,
+			v1.z ^ v2.z,
+			v1.w ^ v2.w);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> operator<<
+	(
+		tvec4<T> const & v,
+		typename tvec4<T>::value_type const & s
+	)
+	{
+		return tvec4<T>(
+			v.x << s,
+			v.y << s,
+			v.z << s,
+			v.w << s);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> operator<<
+	(
+		typename tvec4<T>::value_type const & s,
+		tvec4<T> const & v
+	)
+	{
+		return tvec4<T>(
+			s << v.x,
+			s << v.y,
+			s << v.z,
+			s << v.w);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> operator<<
+	(
+		tvec4<T> const & v1,
+		tvec4<T> const & v2
+	)
+	{
+		return tvec4<T>(
+			v1.x << v2.x,
+			v1.y << v2.y,
+			v1.z << v2.z,
+			v1.w << v2.w);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> operator>>
+	(
+		tvec4<T> const & v,
+		typename tvec4<T>::value_type const & s
+	)
+	{
+		return tvec4<T>(
+			v.x >> s,
+			v.y >> s,
+			v.z >> s,
+			v.w >> s);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> operator>>
+	(
+		typename tvec4<T>::value_type const & s,
+		tvec4<T> const & v
+	)
+	{
+		return tvec4<T>(
+			s >> v.x,
+			s >> v.y,
+			s >> v.z,
+			s >> v.w);
+	}
+
+	template <typename T>
+	GLM_FUNC_QUALIFIER tvec4<T> operator>>
+	(
+		tvec4<T> const & v1,
+		tvec4<T> const & v2
+	)
+	{
+		return tvec4<T>(
+			v1.x >> v2.x,
+			v1.y >> v2.y,
+			v1.z >> v2.z,
+			v1.w >> v2.w);
+	}
+
+	template <typename T> 
+	GLM_FUNC_QUALIFIER tvec4<T> operator~
+	(
+		tvec4<T> const & v
+	)
+	{
+		return tvec4<T>(
+			~v.x,
+			~v.y,
+			~v.z,
+			~v.w);
+	}
+
+	//////////////////////////////////////
+	// tref definition
+
+	template <typename T> 
+	tref4<T>::tref4
+	(
+		T & x, 
+		T & y, 
+		T & z, 
+		T & w
+	) :
+		x(x),
+		y(y),
+		z(z),
+		w(w)
+	{}
+
+	template <typename T> 
+	tref4<T>::tref4
+	(
+		tref4<T> const & r
+	) :
+		x(r.x),
+		y(r.y),
+		z(r.z),
+		w(r.w)
+	{}
+
+	template <typename T> 
+	tref4<T>::tref4
+	(
+		tvec4<T> const & v
+	) :
+		x(v.x),
+		y(v.y),
+		z(v.z),
+		w(v.w)
+	{}
+
+	template <typename T> 
+	tref4<T>& tref4<T>::operator= 
+	(
+		tref4<T> const & r
+	)
+	{
+		x = r.x;
+		y = r.y;
+		z = r.z;
+		w = r.w;
+		return *this;
+	}
+
+	template <typename T> 
+	tref4<T>& tref4<T>::operator= 
+	(
+		tvec4<T> const & v
+	)
+	{
+		x = v.x;
+		y = v.y;
+		z = v.z;
+		w = v.w;
+		return *this;
+	}
+
+}//namespace detail
 }//namespace glm