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


On 01/02/12 11:59, Noel Grandin wrote:


On 2012-02-01 13:58, Noel Power wrote:

e.g. I removed the maLayoutNames.clear() from :~SdPresLayoutDlg() as the vector will go out of scope here anyway and delete the container contents.


Really?
I wasn't sure about that - the boost documentation isn't that great.
So I scanned the LibO codebase and other places that use a ptr_vector are doing clear().
I agree I find the boost documentation... sparse, http://www.boost.org/doc/libs/1_48_0/libs/ptr_container/doc/ptr_container.html e.g. states a couple of lines down in the Motivation section "for each of the standard containers there is a pointer container equivalent that takes ownership of the objects in an exception safe manner"

Still that wasn't clear enough for me so I wrote a small test program and tested it. ( I didn't even find a description of what clear() does e.g. that it removes and deletes the elements )

Noel

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.