
18 Feb
2006
18 Feb
'06
12:23 a.m.
David Abrahams wrote:
Doug Gregor <dgregor@cs.indiana.edu> 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