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


To me, both look equally wrong if OUString is considered immutable, and
equally OK if it isn't.

Ah, but if you let your C# (or Java?) exposure influence you, foo =
foo + bar looks ok even if OUString is considered immutable. The old
object that the foo variable refered to is lost (unless it had other
references), and foo is set to refer to a new object which is the
concatenation of the old foo and bar. Not any stranger than tem = foo
+ bar; foo = null.

But foo += bar looks weird, as it seems to say that the immutable
object that foo refers to gets something appended to it.

At least thinking of C# is how I explain to myself why I like one but
not the other... But sure, I know that variables and objects in C++ is
a completely different thing than in C# or Java, despite superficial
similarities

--tml

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.