[PATCH] Specialize string::replace

Paolo Carlini pcarlini@unitus.it
Mon Mar 25 00:37:00 GMT 2002


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.




More information about the Libstdc++ mailing list