simple function template problem

Max Lawson mlawson@drfmc.ceng.cea.fr
Thu Jun 4 04:29:00 GMT 1998


> 
> [myhost] more x.C
> template <class T> 
> void foo(T& t) {
>   T::iterator itr;
   ^^^
      you have to replace this with "typename T::iterator itr;"

"typename" is the keyword used to tell the compiler that what's following 
is a type-name (hmmm). 

I thought that the compiler used to issue a warning about missing keyword 
'typename' ... ?!

regards, Max

> }
>  
> [myhost] g++ x.C
> x.C: In function `void foo(T &)':
> x.C:3: parse error before `;'
> [myhost] g++ -v
> Reading specs from /packages2/gnu/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.90.29/specs
> gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)
> 
> 
> ps: does anyone know an eta for namespaces???
> 



More information about the Gcc-bugs mailing list