
Matt Calabrese skrev:
On Mon, Mar 2, 2009 at 6:11 PM, Scott McMurray <me22.ca+boost@gmail.com>wrote:
It seems to me that if you need unchecked, then the class shouldn't be storing the capacity at all (outside of debug versions), as it's unnecessary overhead, which suggests to me that it would be the domain of a separate, obviously unsafe class (unchecked_vector?).
True, or behavior could be specified by a template argument -- one instantiation has a static max_size() function that yields the appropriate value based on the N argument and has an unsafe, unchecked push_back, the other is more flexible/safe and behaves more similarly to vector.
We can't really implement a growing push_back() or reserve() without a capacity. I think static_auto_buffer<T,N> where T is a POD might fill a small niche. So I can provide both classes. -Thorsten