"What's in a (type) name ?" Here's an exercise that demonstrates why and how to use typename , using an idiom that's common in the standard library.
What is typename , and what does it do?
What, if anything, is wrong with the code below?
template<typename T> class X_base { public: typedef T instantiated_type; }; template<typename A, typename B> class X : public X_base<B> { public: bool operator()( const instantiated_type& i ) const { return i != instantiated_type(); } // ... more stuff ... };