This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Unuglified name in __normal_iterator
- From: Paolo Carlini <pcarlini at suse dot de>
- To: caj at cs dot york dot ac dot uk
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Sun, 17 Apr 2005 19:57:03 +0200
- Subject: Re: Unuglified name in __normal_iterator
- References: <30039.195.137.95.70.1113757633.squirrel@195.137.95.70>
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.