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: Unuglified name in __normal_iterator


> 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.
>



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