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
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice