This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: [RFC] libstdc++/8780


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


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