|  |  16.2.8 The typenameKeyword
The typenamekeyword was added to C++ after the initial
specification and is not recognized by all compilers.  It is a hint to
the compiler that a name following the keyword is the name of a type.
In the usual case, the compiler has sufficient context to know that a
symbol is a defined type, as it must have been encountered earlier in
the compilation: 
 |  | 
 class Foo
{
public:
  typedef int map_t;
};
void
func ()
{
  Foo::map_t m;
}
 | 
 
Here, map_tis a type defined in classFoo.  However, iffunchappened to be a function template, the class which contains
themap_ttype may be a template parameter.  In this case, the
compiler simply needs to be guided by qualifyingT::map_tas a
type name: 
 |  | 
 class Foo
{
public:
  typedef int map_t;
};
template <typename T>
void func ()
{
  typename T::map_t t;
}
 | 
 
 |