This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Simple program won't compile


On Jan 22, 2001, Rodrigo de Salvo Braz <braz@students.uiuc.edu> wrote:

> Basically, I can't use iterators of containers that are
> arguments of template functions. Does anyone knows why?

Because template-dependent nested type names must be preceded by the
keyword `typename' in ISO C++:

> template <class Container> void foo (Container& c) {
>         Container::iterator i; // THIS IS THE PROBLEM.
       ^^ typename

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]