This is the mail archive of the gcc-bugs@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: -pedantic, and templates, and iterators --> Oh my!


> 	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

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