Template functions with STL in gcc 3.2.2
Nathan Sidwell
nathan@codesourcery.com
Sat Jul 26 20:59:00 GMT 2003
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
More information about the Gcc
mailing list