On occasion I\'ve seen some really indecipherable error messages spit out by gcc when using templates... Specifically, I\'ve had problems where seemingly correc
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:templateClass MyClass { typename T::SubType * ptr; ... }; Here,
typenameis used to clarify thatSubTypeis a type ofclass T. Thus,ptris a pointer to the typeT::SubType. Withouttypename,SubTypewould be considered a static member. ThusT::SubType * ptrwould be a multiplication of value
SubTypeof typeTwithptr.