Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index



On 2012-10-01 09:49, David Tardon wrote:
  I find it perfectly reasonable that a variable of a value type (as
opposed to polymorphic type) is assignable. In fact, I would be
surprised if it were not. Value types are supposed to mimic the behavior
of primitive types; that is why copy constructor and operator= are
created by the compiler unless one disables them. You are not surprised
that



David, I agree with you - what I'm really getting at here is that it seems perfectly reasonable to me to fold the functionality of OUStringBuffer into OUString, making our string classes that much simpler. Otherwise we're going to end up constantly converting between the two for no good reason that I can see.

We'd have to make the following changes to struct rtl_uString:
- add (or steal from somewhere) a single bit to indicate whether or not the buffer field contained a read-only array of chars
- a 'sal_uInt32 nCapacity' field.

And then we can make the OUString methods smart enough to do a copy-on-write if the OUString contains a read-only buffer.


Disclaimer: http://www.peralex.com/disclaimer.html



Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.