OUString is mutable?

Norbert Thiebaud nthiebaud at gmail.com
Fri Sep 28 07:46:20 PDT 2012


On Fri, Sep 28, 2012 at 9:05 AM, Noel Grandin <noel at peralex.com> wrote:
> If you tell me that the saving from not having the nCapacity field is the
> motivation, then I get understand, but then we should update the docs to
> reflect that fact, rather than pretending that OUString is immutable.

>From what I gathered: the thing pointed to by OUString _is_ immutable
but you can make a OUString point to another 'immutable content'.
iow it is not OUString that is immutable... but it's 'payload'.

I may be wrong, but I assume that the reason OUString is like that is
not just to save a nCapacity... but also because there are assumption
you can make if that property is true (that OUString only point to
immutable data, regarding memory allocation, copy, clone etc...

Norbert


More information about the LibreOffice mailing list