Re: [gtkmm] Glib::Unicode::toupper can't be used the same way as toupper



On Sat, 2002-07-13 at 07:48, Marcelo E. Magallon wrote:
> >> Morten Brix Pedersen <morten wtf dk> writes:
> 
>  > It's Glib::ustring which fails, not std::string.
> 
>  Oh.  I'm sorry.
> 
>  Looking at ustring.h, operator* returns a value, not a reference.
>  Transform needs a reference in order to work.  The documentation for
>  Glib::ustring says:
> 
>  * A writeable iterator isn't provided because:  The number of bytes of
>  * the old UTF-8 character and the new one to write could be different.
>  * Therefore, any write operation would invalidate all other iterators
>  * pointing into the same string.
> 

I don't believe this is a good enough reason not to provide writeable
iterators.  The same argument applies to vectors, there are operations
on a vector that will invalidate all iterators, and yet we still have
iterators and documentation pointing this out.

Iterators form the basis for the STL algorithms, so we need to provide
them.  The only way I could see this not making sense is if writing to
the iterator invalidated *that* iterator as well.

Regards,
Carl





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]