Subject: Re: [boost] Stack-based vector container
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2011-01-23 20:13:03
On Sun, Jan 23, 2011 at 4:46 PM, Howard Hinnant
> 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?
Assuming that "we just want it to be faster than std::vector in doing
X and Y", someone could see the limitations of std::vector as
nuisance. Yet this is an indication that performance considerations
will probably trump all other design decisions, since std::vector
implements a pretty basic concept already. Paraphrasing my earlier
concerns, the question is are we going to end up with something
universal enough to be reusable, or will its own limitations become
nuisance in other (even similar) situations?
Reverge Studios, Inc.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk