This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Template functions with STL in gcc 3.2.2
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Rob Emanuele <rje at cyan dot com>
- Cc: gcc at gnu dot org
- Date: Sat, 26 Jul 2003 20:25:22 +0100
- Subject: Re: Template functions with STL in gcc 3.2.2
- Organization: Codesourcery LLC
- References: <000501c353aa$eaad5680$a301a8c0@rje1xp>
Rob Emanuele wrote:
Hello,
I've got two template functions below. They compile and work under Visual
C++ (which does let some weird code through). Using GCC 3.2.2 the second
fucntion will not compile. The line "T::const_iterator it = group.begin();"
shows a "parse error befire '=' token".
Any ideas why it can't compile that?
you are missing a typename. [14.6] of the std will tell you why you
have to say
typename T::const_iterator it = ...
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
The voices in my head said this was stupid too
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk