Boost logo

Boost :

Subject: Re: [boost] [string] proposal
From: Ivan Le Lann (ivan.lelann_at_[hidden])
Date: 2011-01-26 09:58:03


Yakov Galka wrote :
> Excuse my ignorance, but can someone explain to me why people are so keen on
> immutable strings? Aren't they basically the same as 'shared_ptr<const
> std::string>'?

<snip>
>
> > create a class called boost::string that will have
> > all the properties that a string handling class in 2011+ A.D.
> > should have, basically what std::string should have been.
> >
>
> ?
> What are those properties? Isn't std::string *is* what it should have been?
> Do you mean that you want to put there in any possible algorithm you can
> imagine?
>

Do you really consider a structure allowing anybody to change any byte
in its internal representation, eventually breaking its validity, as a
suitable candidate for a publicly used, standard, encoded string?

If the message is "Don't mess with my bytes, use my vendor high level
API to access me", we should not exspect C++ developpers to get it by
providing an hazardous backward compatible API.

I see the immutable string proposal as a way to express the definitely
needed breaking change in our string handling habits. A kind of shortcut
way, though, but quite a good one.

Regards,
Ivan.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk