This is the mail archive of the gcc-help@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]
Other format: [Raw text]

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


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