A side note on grumpy's:
Consider:
It is clear that you want the type my_traits<foo>::char_t* to be typedef'd as ptr_t, but the compiler seeing this, will think that my_traits<foo>::char_t is a static member of the class (even in cases for which this makes no sense, the compiler has no way of really knowing this).Code:struct foo { typedef my_traits<foo>::char_t* ptr_t; };
Typename helps it along:
Code:struct foo { typedef typename my_traits<foo>::char_t* ptr_t; };