Index: trunk/nv/stl/rtti_support.hh
===================================================================
--- trunk/nv/stl/rtti_support.hh	(revision 381)
+++ trunk/nv/stl/rtti_support.hh	(revision 381)
@@ -0,0 +1,93 @@
+// Copyright (C) 2015 ChaosForge Ltd
+// http://chaosforge.org/
+//
+// This file is part of NV Libraries.
+// For conditions of distribution and use, see copyright notice in nv.hh
+
+/**
+ * @file rtti_support.hh
+ * @author Kornel Kisielewicz
+ * @brief RTTI emulation
+ * 
+ * This is the minimal support header for our rtti to work.
+ * TODO: not thread safe - once constexpr works move to runtime hash!
+ */
+
+#ifndef NV_STL_RTTI_SUPPORT_HH
+#define NV_STL_RTTI_SUPPORT_HH
+
+#define NV_RTTI_DECLARE(T) \
+namespace nv { \
+template<> struct rtti_type_hash< T > { \
+	static const char* name() { return #T; } \
+	static nv::uint64 hash() { \
+		static const nv::uint64 value = nv::rtti_hash(#T); \
+		return value; \
+	} \
+};} \
+
+#define NV_RTTI_DECLARE_NAME(T,NAME) \
+namespace nv { \
+template<> struct rtti_type_hash< T > { \
+	static const char* name() { return NAME; } \
+	static nv::uint64 hash() { \
+		static const nv::uint64 value = nv::rtti_hash(#T); \
+		return value; \
+				} \
+};} \
+
+namespace nv
+{
+
+	namespace detail
+	{
+//		static NV_CONSTEXPR unsigned long long rtti_hash_basis = 14695981039346656037ULL;
+//		static NV_CONSTEXPR unsigned long long rtti_hash_prime = 1099511628211ULL;
+		static unsigned long long rtti_hash_basis = 14695981039346656037ULL;
+		static unsigned long long rtti_hash_prime = 1099511628211ULL;
+
+// 		constexpr uint64 rtti_hash_impl( char c, const char* remain, uint64 value )
+// 		{
+// 			return c == 0 ? value : rtti_hash_impl( remain[0], remain + 1, ( value ^ (uint64)c ) * rtti_hash_prime );
+// 		}
+
+		template < typename T >	struct rtti_type_fail { static const bool value = false; };
+	}
+
+// 	// compile-time hash
+// 	constexpr uint64 rtti_const_hash( const char* str )
+// 	{
+// 		return detail::hash_impl( str[0], str + 1, detail::hash_basis );
+// 	}
+
+	// run-time hash
+	inline uint64 rtti_hash( const char* str )
+	{
+		uint64 hash = detail::rtti_hash_basis;
+		while ( *str != 0 )
+		{
+			hash ^= (uint64)str[0];
+			hash *= detail::rtti_hash_prime;
+			++str;
+		}
+		return hash;
+	}
+
+	template < typename T >
+	struct rtti_type_hash
+	{
+		static uint64 hash()
+		{
+			static_assert( NV_TYPE_FAIL(T), "Type not registered!" );
+			return 0;
+		}
+		static const char* name()
+		{
+			static_assert( NV_TYPE_FAIL( T ), "Type not registered!" );
+			return nullptr;
+		}
+	};
+
+}
+
+#endif // NV_STL_RTTI_SUPPORT_HH
Index: trunk/nv/stl/rtti_types.hh
===================================================================
--- trunk/nv/stl/rtti_types.hh	(revision 381)
+++ trunk/nv/stl/rtti_types.hh	(revision 381)
@@ -0,0 +1,44 @@
+// Copyright (C) 2015 ChaosForge Ltd
+// http://chaosforge.org/
+//
+// This file is part of NV Libraries.
+// For conditions of distribution and use, see copyright notice in nv.hh
+
+/**
+* @file rtti_types.hh
+* @author Kornel Kisielewicz
+* @brief RTTI emulation - basic types
+*/
+
+#ifndef NV_STL_RTTI_TYPES_HH
+#define NV_STL_RTTI_TYPES_HH
+
+#include <nv/core/common.hh>
+#include <nv/stl/math.hh>
+#include <nv/stl/rtti_support.hh>
+
+NV_RTTI_DECLARE( void )
+NV_RTTI_DECLARE( bool )
+NV_RTTI_DECLARE( char )
+NV_RTTI_DECLARE_NAME( nv::sint8, "sint8" )
+NV_RTTI_DECLARE_NAME( nv::uint8, "uint8" )
+NV_RTTI_DECLARE_NAME( nv::sint16, "sint16" )
+NV_RTTI_DECLARE_NAME( nv::uint16, "uint16" )
+NV_RTTI_DECLARE_NAME( nv::sint32, "sint32" )
+NV_RTTI_DECLARE_NAME( nv::uint32, "uint32" )
+NV_RTTI_DECLARE_NAME( nv::sint64, "sint64" )
+NV_RTTI_DECLARE_NAME( nv::uint64, "uint64" )
+NV_RTTI_DECLARE_NAME( nv::f32, "f32" )
+NV_RTTI_DECLARE_NAME( nv::f64, "f64" )
+NV_RTTI_DECLARE( nv::vec2 )
+NV_RTTI_DECLARE( nv::vec3 )
+NV_RTTI_DECLARE( nv::vec4 )
+NV_RTTI_DECLARE( nv::ivec2 )
+NV_RTTI_DECLARE( nv::ivec3 )
+NV_RTTI_DECLARE( nv::ivec4 )
+NV_RTTI_DECLARE( nv::mat2 )
+NV_RTTI_DECLARE( nv::mat3 )
+NV_RTTI_DECLARE( nv::mat4 )
+NV_RTTI_DECLARE( nv::quat )
+
+#endif // NV_STL_RTTI_TYPES_HH
Index: trunk/nv/stl/string.hh
===================================================================
--- trunk/nv/stl/string.hh	(revision 380)
+++ trunk/nv/stl/string.hh	(revision 381)
@@ -448,17 +448,3 @@
 }
 
-namespace std
-{
-
-	template<>
-	struct hash< nv::string_base >
-	{
-		std::size_t operator()( const nv::string_base& s ) const
-		{
-			return s.hash();
-		}
-	};
-
-}
-
 #endif // NV_CORE_STRING_HH
Index: trunk/nv/stl/traits/common.hh
===================================================================
--- trunk/nv/stl/traits/common.hh	(revision 381)
+++ trunk/nv/stl/traits/common.hh	(revision 381)
@@ -0,0 +1,190 @@
+// Copyright (C) 2015 ChaosForge Ltd
+// http://chaosforge.org/
+//
+// This file is part of NV Libraries.
+// For conditions of distribution and use, see copyright notice in nv.hh
+/**
+* @file common.hh
+* @author Kornel Kisielewicz epyon@chaosforge.org
+* @brief type traits - common traits used everywhere
+*/
+
+#ifndef NV_STL_TRAITS_COMMON_HH
+#define NV_STL_TRAITS_COMMON_HH
+
+#include <nv/core/common.hh>
+
+namespace nv
+{
+
+	template< typename T, T VALUE>
+	struct integral_constant
+	{
+		static const T value = VALUE;
+		typedef T value_type;
+		typedef integral_constant<T, VALUE> type;
+		NV_CONSTEXPR operator value_type() const NV_NOEXCEPT{ return ( value ); }
+		NV_CONSTEXPR value_type operator()() const NV_NOEXCEPT{ return value; }
+	};
+
+	// TODO: Propagate
+	template< bool B >
+	using bool_constant = integral_constant < bool, B > ;
+
+	typedef bool_constant<true> true_type;
+	typedef bool_constant<false> false_type;
+
+	template< bool Test, typename T = void>
+	struct enable_if {};
+
+	template< typename T >
+	struct enable_if < true, T >
+	{
+		typedef T type;
+	};
+
+	template< bool Test, typename T = void>
+	using enable_if_t = typename enable_if< Test, T >::type;
+
+	template< bool Test, typename T1, typename T2 >
+	struct conditional
+	{
+		typedef T2 type;
+	};
+
+	template< typename T1, typename T2>
+	struct conditional < true, T1, T2 >
+	{
+		typedef T1 type;
+	};
+
+	template< bool Test, typename T1, typename T2 >
+	using conditional_t = typename conditional< Test, T1, T2 >::type;
+
+	template < typename T1, typename T2 >
+	struct is_same : false_type {};
+
+	template < typename T >
+	struct is_same < T, T > : true_type{};
+
+	// TODO: these seem to simple compared to MSVC/GCC - so we'll leave them in
+	// detail - research why it is so.
+	template < typename T >	struct is_const : false_type {};
+	template < typename T > struct is_const < T const > : true_type{};
+	template < typename T > struct is_volatile : false_type {};
+	template < typename T > struct is_volatile < T volatile > : true_type{};
+	// TODO END
+
+	// add const volatile and reference mutators
+
+	template< typename T > struct add_const          { typedef const T type; };
+	template< typename T > struct add_volatile       { typedef volatile T type; };
+	template< typename T > struct add_cv             { typedef const volatile T type; };
+	
+	template< typename T > struct add_reference             { typedef T& type; };
+	template<> struct add_reference < void >                { typedef void type; };
+	template<> struct add_reference < const void >          { typedef void type; };
+	template<> struct add_reference < volatile void >       { typedef void type; };
+	template<> struct add_reference < const volatile void > { typedef void type; };
+
+	template< typename T > struct add_rvalue_reference             { typedef T&& type; };
+	template<> struct add_rvalue_reference < void >                { typedef void type; };
+	template<> struct add_rvalue_reference < const void >          { typedef void type; };
+	template<> struct add_rvalue_reference < volatile void >       { typedef void type; };
+	template<> struct add_rvalue_reference < const volatile void > { typedef void type; };
+
+	template< typename T > using add_lvalue_reference = add_reference<T>;
+
+	template< typename T > using add_const_t            = typename add_const<T>::type;
+	template< typename T > using add_volatile_t         = typename add_volatile<T>::type;
+	template< typename T > using add_cv_t               = typename add_cv<T>::type;
+	template< typename T > using add_reference_t        = typename add_reference<T>::type;
+	template< typename T > using add_lvalue_reference_t = typename add_lvalue_reference<T>::type;
+	template< typename T > using add_rvalue_reference_t = typename add_rvalue_reference<T>::type;
+
+	// remove const volatile and reference mutators
+
+	template< typename T > struct remove_reference { typedef T type; };
+	template< typename T > struct remove_reference < T& >                     { typedef T type; };
+	template< typename T > struct remove_reference < T&& >                    { typedef T type; };
+
+	template< typename T > struct remove_const                                { typedef T type; };
+	template< typename T > struct remove_const < const T >                    { typedef T type; };
+	template< typename T > struct remove_const < const T[] >                  { typedef T type[]; };
+	template< typename T, unsigned int N > struct remove_const < const T[N] > { typedef T type[N]; };
+
+	template< typename T > struct remove_volatile                             { typedef T type; };
+	template< typename T > struct remove_volatile < volatile T >              { typedef T type; };
+	template< typename T > struct remove_volatile < volatile T[] >            { typedef T type[]; };
+	template< typename T, unsigned int N > struct remove_volatile < volatile T[N] > { typedef T type[N]; };
+
+	template< typename T >
+	struct remove_cv
+	{
+		typedef typename remove_const< typename remove_volatile<T>::type >::type type;
+	};
+
+	template< typename T >
+	struct remove_cvr
+	{
+		typedef typename remove_cv< typename remove_reference<T>::type >::type type;
+	};
+
+	template< typename T > using remove_reference_t = typename remove_reference<T>::type;
+	template< typename T > using remove_const_t     = typename remove_const<T>::type;
+	template< typename T > using remove_volatile_t  = typename remove_volatile<T>::type;
+	template< typename T > using remove_cvr_t       = typename remove_cvr<T>::type;
+	template< typename T > using remove_cv_t        = typename remove_cv<T>::type;
+
+	// pointer/array mutators
+
+	template< typename T > struct add_pointer { typedef typename remove_reference<T>::type *type; };
+	
+	template< typename T > struct remove_pointer { typedef T type; };
+	template< typename T > struct remove_pointer < T* > { typedef T type; };
+	template< typename T > struct remove_pointer < T* const > { typedef T type; };
+	template< typename T > struct remove_pointer < T* volatile > { typedef T type; };
+	template< typename T > struct remove_pointer < T* const volatile > { typedef T type; };
+
+	template< typename T > struct remove_extent { typedef T type; };
+	template< typename T > struct remove_extent < T[] > { typedef T type; };
+	template< typename T, unsigned int N > struct remove_extent < T[N] > { typedef T type; };
+
+	template< typename T > struct remove_all_extents { typedef T type; };
+	template< typename T > struct remove_all_extents < T[] > { typedef typename remove_all_extents<T>::type type; };
+	template< typename T, unsigned int N > struct remove_all_extents < T[N] > { typedef typename remove_all_extents<T>::type type; };
+
+	template< typename T > using add_pointer_t        = typename add_pointer<T>::type;
+	template< typename T > using remove_pointer_t     = typename remove_pointer<T>::type;
+	template< typename T > using remove_extent_t      = typename remove_extent<T>::type;
+	template< typename T > using remove_all_extents_t = typename remove_all_extents<T>::type;
+
+	template < typename T >	struct is_lvalue_reference : false_type {};
+	template < typename T >	struct is_lvalue_reference < T& > : true_type{};
+	template < typename T >	struct is_rvalue_reference : false_type {};
+	template < typename T >	struct is_rvalue_reference < T&& > : true_type{};
+
+	template < typename T >
+	typename add_rvalue_reference<T>::type declval();
+
+	template< typename T >
+	inline typename remove_reference<T>::type&& move( T&& arg ) NV_NOEXCEPT
+	{
+		return ( ( typename remove_reference<T>::type&& )arg );
+	}
+
+	template < typename T >
+	inline T&& forward( typename remove_reference<T>::type& t )
+	{
+		return static_cast<T&&>( t );
+	}
+
+		template < typename T >
+	inline T&& forward( typename remove_reference<T>::type&& t ) NV_NOEXCEPT
+	{
+		static_assert( !is_lvalue_reference<T>::value, "Can not forward an rvalue as an lvalue." );
+		return static_cast<T&&>( t );
+	}
+}
+
+#endif // NV_STL_TRAITS_COMMON_HH
