Index: trunk/src/lua/lua_glm.cc
===================================================================
--- trunk/src/lua/lua_glm.cc	(revision 85)
+++ trunk/src/lua/lua_glm.cc	(revision 113)
@@ -46,5 +46,5 @@
 template < typename T > struct nlua_vec_constructor< T, 3 > {
 	static inline T construct( lua_State* L, int index ) {
-		typedef glm::detail::tvec2<T::value_type> vec2;
+		typedef glm::detail::tvec2<typename T::value_type> vec2;
 		if ( lua_type( L, index ) == LUA_TUSERDATA )
 		{
@@ -66,6 +66,6 @@
 template < typename T > struct nlua_vec_constructor< T, 4 > {
 	static inline T construct( lua_State* L, int index ) {
-		typedef glm::detail::tvec2<T::value_type> vec2;
-		typedef glm::detail::tvec3<T::value_type> vec3;
+		typedef glm::detail::tvec2<typename T::value_type> vec2;
+		typedef glm::detail::tvec3<typename T::value_type> vec3;
 		if ( lua_type( L, index ) == LUA_TUSERDATA )
 		{
@@ -108,5 +108,5 @@
 int nlua_vec_new( lua_State* L )
 {
-	nlua_push_vec( L, nlua_vec_constructor<T,sizeof( T ) / sizeof( T::value_type )>::construct( L, 1 ) );
+	nlua_push_vec( L, nlua_vec_constructor<T,sizeof( T ) / sizeof( typename T::value_type )>::construct( L, 1 ) );
 	return 1;
 }
@@ -115,5 +115,5 @@
 int nlua_vec_call( lua_State* L )
 {
-	nlua_push_vec( L, nlua_vec_constructor<T,sizeof( T ) / sizeof( T::value_type )>::construct( L, 2 ) );
+	nlua_push_vec( L, nlua_vec_constructor<T,sizeof( T ) / sizeof( typename T::value_type )>::construct( L, 2 ) );
 	return 1;
 }
@@ -130,8 +130,8 @@
 {
 	if ( lua_type( L, 1 ) == LUA_TNUMBER )
-		nlua_push_vec<T>( L, (T::value_type)(lua_tonumber( L, 1 )) + nlua_to_vec<T>( L, 2 ) );
+		nlua_push_vec<T>( L, (typename T::value_type)(lua_tonumber( L, 1 )) + nlua_to_vec<T>( L, 2 ) );
 	else
 		if ( lua_type( L, 2 ) == LUA_TNUMBER )
-			nlua_push_vec<T>( L, nlua_to_vec<T>( L, 1 ) + (T::value_type)(lua_tonumber( L, 2 )) );
+			nlua_push_vec<T>( L, nlua_to_vec<T>( L, 1 ) + (typename T::value_type)(lua_tonumber( L, 2 )) );
 		else
 			nlua_push_vec<T>( L, nlua_to_vec<T>( L, 1 ) + nlua_to_vec<T>( L, 2 ) );
@@ -143,8 +143,8 @@
 {
 	if ( lua_type( L, 1 ) == LUA_TNUMBER )
-		nlua_push_vec<T>( L, (T::value_type)(lua_tonumber( L, 1 )) - nlua_to_vec<T>( L, 2 ) );
+		nlua_push_vec<T>( L, (typename T::value_type)(lua_tonumber( L, 1 )) - nlua_to_vec<T>( L, 2 ) );
 	else
 		if ( lua_type( L, 2 ) == LUA_TNUMBER )
-			nlua_push_vec<T>( L, nlua_to_vec<T>( L, 1 ) - (T::value_type)(lua_tonumber( L, 2 )) );
+			nlua_push_vec<T>( L, nlua_to_vec<T>( L, 1 ) - (typename T::value_type)(lua_tonumber( L, 2 )) );
 		else
 			nlua_push_vec<T>( L, nlua_to_vec<T>( L, 1 ) - nlua_to_vec<T>( L, 2 ) );
@@ -156,8 +156,8 @@
 {
 	if ( lua_type( L, 1 ) == LUA_TNUMBER )
-		nlua_push_vec<T>( L, (T::value_type)(lua_tonumber( L, 1 )) * nlua_to_vec<T>( L, 2 ) );
+		nlua_push_vec<T>( L, (typename T::value_type)(lua_tonumber( L, 1 )) * nlua_to_vec<T>( L, 2 ) );
 	else
 		if ( lua_type( L, 2 ) == LUA_TNUMBER )
-			nlua_push_vec<T>( L, nlua_to_vec<T>( L, 1 ) * (T::value_type)(lua_tonumber( L, 2 )) );
+			nlua_push_vec<T>( L, nlua_to_vec<T>( L, 1 ) * (typename T::value_type)(lua_tonumber( L, 2 )) );
 		else
 			nlua_push_vec<T>( L, nlua_to_vec<T>( L, 1 ) * nlua_to_vec<T>( L, 2 ) );
@@ -169,8 +169,8 @@
 {
 	if ( lua_type( L, 1 ) == LUA_TNUMBER )
-		nlua_push_vec<T>( L, (T::value_type)(lua_tonumber( L, 1 )) / nlua_to_vec<T>( L, 2 ) );
+		nlua_push_vec<T>( L, (typename T::value_type)(lua_tonumber( L, 1 )) / nlua_to_vec<T>( L, 2 ) );
 	else
 		if ( lua_type( L, 2 ) == LUA_TNUMBER )
-			nlua_push_vec<T>( L, nlua_to_vec<T>( L, 1 ) / (T::value_type)(lua_tonumber( L, 2 )) );
+			nlua_push_vec<T>( L, nlua_to_vec<T>( L, 1 ) / (typename T::value_type)(lua_tonumber( L, 2 )) );
 		else
 			nlua_push_vec<T>( L, nlua_to_vec<T>( L, 1 ) / nlua_to_vec<T>( L, 2 ) );
@@ -217,7 +217,7 @@
 	{
 		switch (len) {
-		case 2 : nlua_push_vec( L, glm::detail::tvec2<T::value_type>( (*v)[nlua_swizzel_lookup[key[0]]], (*v)[nlua_swizzel_lookup[key[1]]] ) ); return 1;
-		case 3 : nlua_push_vec( L, glm::detail::tvec3<T::value_type>( (*v)[nlua_swizzel_lookup[key[0]]], (*v)[nlua_swizzel_lookup[key[1]]], (*v)[nlua_swizzel_lookup[key[2]]] ) ); return 1;
-		case 4 : nlua_push_vec( L, glm::detail::tvec4<T::value_type>( (*v)[nlua_swizzel_lookup[key[0]]], (*v)[nlua_swizzel_lookup[key[1]]], (*v)[nlua_swizzel_lookup[key[2]]], (*v)[nlua_swizzel_lookup[key[3]]] ) ); return 1;
+		case 2 : nlua_push_vec( L, glm::detail::tvec2<typename T::value_type>( (*v)[nlua_swizzel_lookup[key[0]]], (*v)[nlua_swizzel_lookup[key[1]]] ) ); return 1;
+		case 3 : nlua_push_vec( L, glm::detail::tvec3<typename T::value_type>( (*v)[nlua_swizzel_lookup[key[0]]], (*v)[nlua_swizzel_lookup[key[1]]], (*v)[nlua_swizzel_lookup[key[2]]] ) ); return 1;
+		case 4 : nlua_push_vec( L, glm::detail::tvec4<typename T::value_type>( (*v)[nlua_swizzel_lookup[key[0]]], (*v)[nlua_swizzel_lookup[key[1]]], (*v)[nlua_swizzel_lookup[key[2]]], (*v)[nlua_swizzel_lookup[key[3]]] ) ); return 1;
 		default: break;
 		}
@@ -233,7 +233,7 @@
 int nlua_vec_newindex( lua_State* L )
 {
-	typedef glm::detail::tvec2<T::value_type> vec2;
-	typedef glm::detail::tvec3<T::value_type> vec3;
-	typedef glm::detail::tvec4<T::value_type> vec4;
+	typedef glm::detail::tvec2<typename T::value_type> vec2;
+	typedef glm::detail::tvec3<typename T::value_type> vec3;
+	typedef glm::detail::tvec4<typename T::value_type> vec4;
 
 	T* v = nlua_to_pvec<T>( L, 1 );
@@ -247,5 +247,5 @@
 		if ( idx < vlen )
 		{
-			(*v)[idx] = (T::value_type)luaL_checknumber( L, 3 );
+			(*v)[idx] = (typename T::value_type)luaL_checknumber( L, 3 );
 			return 0;
 		}
