|
Boost : |
Subject: Re: [boost] Proposal: Monotonic Containers
From: Christian Schladetsch (christian.schladetsch_at_[hidden])
Date: 2009-06-15 17:02:42
> Christian>
>> It was suggested to me that auto_buffer and monotonic were doing similar
>> things, and that I should investigate using auto_buffer for the storage to
>> remove any redundancy.
>>
>
> Thorsten> I'm not sure why you use the container that way. Don't you
> normally allocate everything at once? If so, then why don't you just do the
> same with the auto_buffer? Again, unitialized_grow() might be useful.
auto_buffer<char, store_n_bytes<N> > as a longer way of saying char [N] is
not compelling and doesn't add anything. growing this is not possible on the
stack, and 'growing' it by moving it to the heap makes it unsuitable as a
storage basis for containers.
What I see instead is that containers like chain<> can use
monotonic::storage where some of the earlier links are on the stack, and
when that is exhausted, the remaining links go on the heap. This is
transparent to the chain. Similiarly for other node-based containers, but
this cannot work for obvious reasons for vector.
Christian.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk