[PATCH] cleaning before = assignment lotuswordpro/source/filter/xfilter/xfparastyle.cxx
serval2412 at yahoo.fr
Tue Jul 17 14:52:22 PDT 2012
Thank you for the links David.
I understand this design :
- avoids duplication
- guarantees that the new object can be completely built before swapping
from old to new one
But I still don't know at which moment do we delete old resources ? Or more
precisely, it seems it doesn't remove anything so how can't it be a leak ?
Other things I read :
"The one thing to be careful of is to make sure that the swap method is a
true swap, and not the default std::swap which uses the copy constructor and
assignment operator itself.
Typically a memberwise swap is used. std::swap works and is 'no-throw'
guaranteed with all basic types and pointer types. Most smart pointers can
also be swapped with a no-throw guarantee."
2) All the subtleties from
which ends with other things again to take into account C++11
To sum up, it's very interesting but clearly it's too complicated for me.
Perhaps by reading it several times, I'll fully understand it (let's be
optimistic :-) )
View this message in context: http://nabble.documentfoundation.org/PATCH-cleaning-before-assignment-lotuswordpro-source-filter-xfilter-xfparastyle-cxx-tp3995480p3996129.html
Sent from the Dev mailing list archive at Nabble.com.
More information about the LibreOffice