Index: /trunk/nv/lua/lua_values.hh
===================================================================
--- /trunk/nv/lua/lua_values.hh	(revision 210)
+++ /trunk/nv/lua/lua_values.hh	(revision 211)
@@ -52,4 +52,6 @@
 		namespace detail
 		{
+			struct void_type {};
+
 			void push_unsigned( lua_State *L, lunsigned v );
 			void push_integer ( lua_State *L, linteger v );
@@ -238,5 +240,5 @@
 
 			template < typename T >
-			inline T get_value( lua_State *L, int index )
+			inline typename std::remove_reference<T>::type get_value( lua_State *L, int index )
 			{
 				typedef typename type_degrade<T>::type degraded;
Index: /trunk/nv/type_traits.hh
===================================================================
--- /trunk/nv/type_traits.hh	(revision 210)
+++ /trunk/nv/type_traits.hh	(revision 211)
@@ -9,4 +9,7 @@
  * @brief type traits
  */
+// TODO: function_traits support only up to 4 parameters because:
+//    -- if you have more than 4 params, you're doing something wrong
+//    -- once the Variadic Templates cometh, for great justice we will win!
 
 #ifndef NV_TYPE_TRAITS_HH
@@ -30,5 +33,5 @@
 	struct is_stdstring
 		: public std::integral_constant<bool,
-		std::is_same< std::string, typename std::remove_cv< std::remove_reference< T > >::type >::value 
+		std::is_same< std::string, typename std::decay< T >::type >::value 
 		>
 	{};
@@ -57,4 +60,125 @@
 	};
 #endif
+
+	namespace detail
+	{
+
+		template < typename F >
+		struct function_traits_impl
+		{
+
+		};
+
+		template < typename R >
+		struct function_traits_impl< R (*)(void) >
+		{
+			typedef R (*type)();
+			typedef R        return_type;
+			typedef void     class_type;
+			static const int arg_count = 0;
+		};
+
+		template < typename R, typename T1 >
+		struct function_traits_impl< R (*)( T1 ) >
+		{
+			typedef R (*type)();
+			typedef R        return_type;
+			typedef void     class_type;
+			static const int arg_count = 1;
+		};
+
+		template < typename R, typename T1, typename T2 >
+		struct function_traits_impl< R (*)( T1, T2 ) >
+		{
+			typedef R (*type)();
+			typedef R        return_type;
+			typedef void     class_type;
+			static const int arg_count = 2;
+		};
+
+		template < typename R, typename T1, typename T2, typename T3 >
+		struct function_traits_impl< R (*)( T1, T2, T3 ) >
+		{
+			typedef R (*type)();
+			typedef R        return_type;
+			typedef void     class_type;
+			static const int arg_count = 3;
+		};
+
+		template < typename R, typename T1, typename T2, typename T3, typename T4 >
+		struct function_traits_impl< R (*)( T1, T2, T3, T4 ) >
+		{
+			typedef R (*type)();
+			typedef R        return_type;
+			typedef void     class_type;
+			static const int arg_count = 4;
+		};
+
+		template < class C, typename R >
+		struct function_traits_impl< R (C::*)() >
+		{
+			typedef R (*type)();
+			typedef R       return_type;
+			typedef C       class_type;
+			static const int arg_count = 0;
+		};
+
+		template < class C, typename R, typename T1 >
+		struct function_traits_impl< R (C::*)( T1 ) >
+		{
+			typedef R (*type)();
+			typedef R       return_type;
+			typedef C       class_type;
+			static const int arg_count = 1;
+		};
+
+		template < class C, typename R, typename T1, typename T2 >
+		struct function_traits_impl< R (C::*)( T1, T2 ) >
+		{
+			typedef R (*type)();
+			typedef R       return_type;
+			typedef C       class_type;
+			static const int arg_count = 2;
+		};
+
+		template < class C, typename R, typename T1, typename T2, typename T3 >
+		struct function_traits_impl< R (C::*)( T1, T2, T3 ) >
+		{
+			typedef R (*type)();
+			typedef R       return_type;
+			typedef C       class_type;
+			static const int arg_count = 3;
+		};
+
+		template < class C, typename R, typename T1, typename T2, typename T3, typename T4 >
+		struct function_traits_impl< R (C::*)( T1, T2, T3, T4 ) >
+		{
+			typedef R (*type)();
+			typedef R       return_type;
+			typedef C       class_type;
+			static const int arg_count = 4;
+		};
+
+	}
+
+	template < typename F >
+	struct function_traits : public detail::function_traits_impl< typename std::add_pointer< F >::type >
+	{
+
+	};
+
+
+	template < typename T >
+	struct return_type
+	{
+		typedef typename function_traits< T >::return_type type;
+	};
+
+	template < typename T >
+	struct memfn_class_type
+	{
+		typedef typename function_traits< T >::class_type type;
+	};
+
 }
 
