Boost logo

Boost :

Subject: Re: [boost] [pool2] Requests for comment
From: Klaim - Joël Lamotte (mjklaim_at_[hidden])
Date: 2012-10-16 18:47:04


On Tue, Oct 16, 2012 at 10:02 PM, Ion Gaztañaga <igaztanaga_at_[hidden]>wrote:

> If you reserve, then stable vector will call the allocator several times
> to reserve memory and fill the internal pool. That memory is probably
> contiguous (it depends on the allocator).

Actually, for a reason I don't understand, using resize instead of reserve
makes even better results both in progressive (one by one) creation of
elements and going through all the elements (using optional as element
allow me to create optional objects without creating the object they
wrap), at least in my tests, that I need to check again.

Joel Lamotte


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk