Boost logo

Boost :

Subject: Re: [boost] Stack-based vector container
From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2011-01-16 11:35:54

Den 16-01-2011 16:13, Domagoj Saric skrev:
> "Thorsten Ottosen" <nesotto_at_[hidden]> wrote in message
>> I expect to finnish pre-review work in february.
> Could you possibly add a policy that would 'produce' a strictly static
> buffer, i.e. that does not use/expand into the heap (to avoid the
> overhead described in the response to David Bergman)...

Maybe. I guess it takes some measurement to see if it is actually
needed. For one, the container will allow you to do

   boost:.auto_buffer<T,N> buffer( n, boost::dont_initialize );

to make it avoid initialization. Futhermore, you may use

   buffer.unchecked_push_back( x );

to avoid code that checks for a full buffer and subsequent expansion.

If that is not good enough, then why not just use boost::array<T,N>?
(that is, if you really never will need the heap for any n)


Boost list run by bdawes at, gregod at, cpdaniel at, john at