Following is the quote from Josuttis book:
The keyword
typenamewas introduced to
specify that the identifier that
follows is a type. Consider the
following example:template <class T> Class MyClass { typename T::SubType * ptr; ... };Here,
typenameis used to clarify that
SubTypeis a type ofclass T. Thus,
ptris a pointer to the type
T::SubType. Withouttypename,SubType
would be considered a static member.
ThusT::SubType * ptrwould be a multiplication of value
SubTypeof typeTwithptr.