Boost logo

Boost :

Subject: Re: [boost] Stack-based vector container
From: Howard Hinnant (howard.hinnant_at_[hidden])
Date: 2011-01-23 19:46:18


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk