[Libreoffice] [PATCH] convert SdPresLayoutDlg from tools/list.hxx to std::map
Noel Power
nopower at suse.com
Wed Feb 1 04:58:12 PST 2012
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120201/1177ce9d/attachment-0001.htm>
More information about the LibreOffice
mailing list