
2 Mar
2009
2 Mar
'09
2:42 p.m.
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).