Hi,
On Mon, Jul 16, 2012 at 01:57:43PM -0700, julien2412 wrote:
Thank you David for your answer.
I updated the way to check self assignment and add the cleaning of members
(see
http://cgit.freedesktop.org/libreoffice/core/commit/?id=00ae1cec08ae970f0640c0cc5d612eb0b9035207)
Heh, it already did self assignment check, just with early return... You
do not have to take my suggestions literally :-)
About the swap part, if you've got an example, I'd be interested.
Okay, you can look at
http://code.google.com/p/multidimalgorithm/source/detail?spec=svn0016d50d9cf6c6437598d196f59b2aa52110c8f9&r=bb3ea2226e49540027df50072aef4c86188f7d64#
Here is a detailed explanation (the example uses friend swap function
instead of member function, but that is just a detail):
http://stackoverflow.com/questions/3279543/what-is-the-copy-and-swap-idiom/3279550#3279550
D.
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.