|
Boost : |
From: Thorsten Ottosen (tottosen_at_[hidden])
Date: 2006-02-17 19:23:01
David Abrahams wrote:
> Doug Gregor <dgregor_at_[hidden]> writes:
>
>>I think the basic guarantee is enough here. Truly paranoid users can
>>copy+swap themselves, but for most purposes you are better off not
>>having two copies of the container in memory. Most people need better
>>performance more than they need the strong guarantee.
>
>
> That's one right way to look at it.
Ok, so if efficiency really matters here, would it not
be best not to call clear(), but try to assign to the
existing elements or create them in-place in the container?
IIUC, all elements in a container are first created on the stack and
then copied into the container. Isn't this right Robert?
-Thorsten
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk