This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: -pedantic, and templates, and iterators --> Oh my!
- To: mfox at cpsc dot ucalgary dot ca
- Subject: Re: -pedantic, and templates, and iterators --> Oh my!
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Fri, 7 Jul 2000 19:31:39 +0200
- CC: gcc-bugs at gcc dot gnu dot org
- References: <20000707110002.A14631@csg.cpsc.ucalgary.ca>
> This one had me scratching my head for a long time. I was
> wondering why all my code compiled and worked just fine, but some of
> my co-workers just couldn't get it to compile. (Isn't it always that
> way?) Basically, the problem is that the combination of -pedantic,
> templates, and the STL, results in parse errors.
Thanks for your bug report. It's not a bug in the compiler, but in
your code. You need to write
DataType addThem() const {
typename list<DataType>::const_iterator
itr(_them.begin()),
end(_them.end());
...
Regards,
Martin