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
typename
was introduced to specify that the identifier that follows is a type. Consider the following example:template
Class MyClass { typename T::SubType * ptr; ... }; Here,
typename
is used to clarify thatSubType
is a type ofclass T
. Thus,ptr
is a pointer to the typeT::SubType
. Withouttypename
,SubType
would be considered a static member. ThusT::SubType * ptr
would be a multiplication of value
SubType
of typeT
withptr
.