This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: STL iterators in gcc 3.2
- From: John Love-Jensen <eljay at adobe dot com>
- To: Alberto Garcia Raboso <Alberto dot Garcia dot Raboso at cern dot ch>, <gcc-help at gcc dot gnu dot org>
- Date: Fri, 25 Oct 2002 10:38:34 -0500
- Subject: Re: STL iterators in gcc 3.2
Hi Alberto,
> 1.- Whereas I didn't need it before, now I have to use the "using
> namespace std" directive if I want to use cout, cin,... and all this
> stuff. Why the change?
Compliance with ISO 14882 specification standard for C++.
> 2.- This is more serious. In my programs I use a lot of STL vectors, and
> so, iterators too. When I had a method with a pointer argument, I passed a
> random iterator to it. It worked fine with previous versions of gcc, but
> not with 3.2. Is there any way to get it work or do I have to come back to
> an older version?
An iterator is not, necessarily, a pointer. It could be -- and often is --
a UDT.
Can you use template methods? (Would that be Generic Programming, of a
sort?)
Do you have a toy example?
This...
void Foo(int* begin, int* end);
...is different from this...
void Foo(vector<int>::iterator begin, vector<int>::iterator end);
--Eljay