[RFC] libstdc++/8780

Gabriel Dos Reis gdr@integrable-solutions.net
Mon Dec 2 05:14:00 GMT 2002


Hi,

Paolo Carlini <pcarlini@unitus.it> writes:

[...]

| The compilation fails with any v3. This seems due to the fact that,
| whereas in v2, for std::vector, simply:
| 
|   typedef value_type* iterator;
| 
| in v3:
| 
|   typedef __gnu_cxx::__normal_iterator<pointer, vector_type> iterator;
| 
| Submitter cites 24.1,(1,2) as implying that the current implementation is
| non conforming.

The submitter is confused.  I would like to see the exact wording from
those paragraphs that may imply that a vector<>::iterator ought to be
a pointer. 


| This seems to me non at all obvious! It is just a QoI issue?
| (in few other widespread implementations iterator *is* just a pointer)

This is a QoI.  I would expect a decent implementation to distinguish
a vector<>::iterator from a plain pointer. 

| Much more generally, I'm interested in knowing why the implementation
| of iterator was changed in such a way in the transition between v2 and v3.

I don't know of the reasons, but I suspect "increase in type safety"
and aid to debugging.

-- Gaby



More information about the Libstdc++ mailing list