
Cory Nelson skrev:
On Mon, Mar 2, 2009 at 4:35 AM, Thorsten Ottosen <thorsten.ottosen@dezide.com> wrote:
Steven Watanabe skrev:
AMDG
Mathias Gaunard wrote:
Thorsten Ottosen wrote:
Basically boost::auto_buffer<T,N> is a C++ version of variable lenght array (from C99). N is known at compile-time. Thus I do not see how it is related to C99 VLAs at all. N is not the number of elements in the container. N controls how much stack storage is allocated. The number of elements is dynamic. Exactly.
[snip]
I think that sounds very useful. I'd be interested in seeing something like that in boost. But it's not anything like C99 VLAs, I wouldn't refer to it as such.
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? -Thorsten