|
Boost : |
From: Thorsten Ottosen (tottosen_at_[hidden])
Date: 2006-02-18 09:37:41
David Abrahams wrote:
> Thorsten Ottosen <tottosen_at_[hidden]> writes:
>>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?
>
>
> Yes, if efficiency really matters, and the container isn't empty, and
> no other considerations contravene this, it would be better. However,
> I think most of the time the container starts out empty anyway, and
> there would only be savings in edge cases.
The latter case "create them in-place in the container"
still seems like something that will remove some overhead.
Sad that the standard can help us here.
-Thorsten
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk