OUString is mutable?

Michael Meeks michael.meeks at suse.com
Fri Sep 28 06:37:54 PDT 2012


Hi Noel,

On Fri, 2012-09-28 at 14:17 +0200, Noel Grandin wrote:
> It just seems to me that we could easily enough steal a bit from the 
> length field to indicate that the buffer is immutable, and then we could 
> reduce our complexity by eliminating OUStringBuffer.

	We already steal bits from the ref-count for magic like this: static
strings, and interned strings ;-)

	The question is - would it be more obvious if:

void method(rtl::OUString &rFoo, rtl::OUString &rBaa)
{
	rFoo += "foo"; // no exception it's mutable.
	rBaa += "baa"; // exception because it's immutable.
}

	:-) i assume not. OTOH - I too am not a huge fan of the sal string
classes for general usability - but I've not done a ton of work with
them recently to be fair.

	ATB,

		Michael.

-- 
michael.meeks at suse.com  <><, Pseudo Engineer, itinerant idiot



More information about the LibreOffice mailing list