Unuglified name in __normal_iterator

Paolo Carlini pcarlini@suse.de
Sun Apr 17 17:56:00 GMT 2005


Hi Chris,

>When we want to wrap bare pointers as iterators in the various containers,
>we use __normal_iterator. This has a member function called base(), which
>provides the raw pointer. This class is used by vector and string.
>
>As far as I can see, this really shouldn't be here. There is a base()
>function on reverse_iterator, but as far as I can see, not anywhere else.
>
Whereas uglifying that name cannot hurt, maybe we are conforming, after
all. The snatch is that, as often reminded, the user cannot know which
other standard names are actually pulled in by an #include (besides
those mandated by the relevant Ch. of the standard, of course).
Therefore, the user cannot anticipate whether class reverse_iterator,
which defines a base() member, is pulled in or not. Therefore, cannot
safely use the name base in a preprocessor macro, I think.

Actually, I find this issue rather interesting, albeit academic, of
course. Comments?

Paolo.



More information about the Libstdc++ mailing list