
24 Jan
2011
24 Jan
'11
12:46 a.m.
On Jan 23, 2011, at 6:59 PM, Emil Dotchevski wrote:
So the only meaningful way to evaluate the benefits of a std::vector alternative is to discuss specific use cases, considering other alternatives as well.
Some use cases: 1. swap. 2. return an auto local from a factory function. 3. desired behavior when capacity exceeds stack space (go to heap or throw an exception?). Sometimes std::vector is going to want to transfer memory ownership. Those are the use cases I would look at first. What does std::vector<T, stack_alloc<T>> do? What does stack_vector<T> do? What do you want to happen? -Howard