Boost logo

Boost :

Subject: Re: [boost] Stack-based vector container
From: Howard Hinnant (howard.hinnant_at_[hidden])
Date: 2010-12-28 22:41:42


On Dec 28, 2010, at 7:58 PM, Dave Abrahams wrote:

> At Tue, 28 Dec 2010 18:36:46 -0500,
> David Bergman wrote:
>>
>> Greg,
>>
>> What you are doing here is to mix two (presumably...) orthogonal
>> aspects, in that you bake in the allocation policy in the vector
>> interface.
>>
>> In fact, a "static allocator" to be used in cases like std::vector
>> was discussed at length on this list a year ago (or was it two
>> years?)
>
> Yeah, an allocator with some internal storage that falls back to the
> heap when it's exausted would allow std::vector's to essentially use
> the "small string optimization."

For example:

http://home.roadrunner.com/~hinnant/stack_alloc.html

-Howard


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