Unuglified name in __normal_iterator

caj@cs.york.ac.uk caj@cs.york.ac.uk
Sun Apr 17 18:42: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?

More personal worry was more that someone might use this function without
realising its non-standard (as reverse_iterator does provide a base
method)...

>
> Paolo.
>




More information about the Libstdc++ mailing list