Boost logo

Boost :

Subject: Re: [boost] [utility] new auto_buffer class --- RFC
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2009-03-02 10:13:15


Mathias Gaunard skrev:
> Thorsten Ottosen wrote:
>
>> Well, AFAIK, they are very similar. You set the capacity once when you
>> initialize am object:
>>
>> boost::auto_buffer<T> buffer( get_max_capacity_from_somewhere() );
>>
>> isn't that exactly what you do with VLAs?
>
> With VLAs, the buffer is on the stack whatever the capacity. With
> auto_buffer, the buffer is on the stack only if the capacity is smaller
> than N (which you define to be 256 by default).

Yes. I'm talking about the conceptual behavior of the class.

-Thorsten


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