This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Simple program won't compile
- To: Rodrigo de Salvo Braz <braz at students dot uiuc dot edu>
- Subject: Re: Simple program won't compile
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 22 Jan 2001 04:34:19 -0200
- Cc: gcc at gcc dot gnu dot org
- Organization: GCC Team, Red Hat
- References: <Pine.GSO.4.10.10101220022270.24722-100000@ux13.cso.uiuc.edu>
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