This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Specialize string::replace
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: Philip Martin <philip at codematters dot co dot uk>
- Cc: libstdc++ at gcc dot gnu dot org, bkoz at redhat dot com, ncm at cantrip dot org
- Date: Mon, 25 Mar 2002 09:38:51 +0100
- Subject: Re: [PATCH] Specialize string::replace
- References: <3C9E85CC.4030806@unitus.it> <87663l4b0r.fsf@codematters.co.uk>
Philip Martin wrote:
>
>iterator is __normal_iterator<pointer, basic_string> and has a base()
>member function that returns a pointer. pointer is the basic_string's
>allocater's pointer type. Is this sufficient? (Even if it is not
>sufficient, it is probably necessary before casting.)
>
>Similarly, const_iterator is __normal_iterator<const_pointer, basic_string>
>and here the base() member function returns a const_pointer.
>
>Do you really have to cast _CharT* to get const _CharT*? Isn't that a
>standard conversion?
>
Thanks for your observations. Very probably you are right, indeed. I was
really worried to do everything in the most correct way, and I admit
that something still escapes me as far as the iterator hierarchy is
concerned, in particulat input_iterators. Now let's look forward for
other opinions, Nathan's one, in particular.
Thanks again,
Paolo.