Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2004-01-22 08:31:59


Jeff Flinn wrote:
>
> Given we have std::vector and boost::array, why are move_ptr<T[],D>
> or even scoped_array, shared_array even needed?

The main (and probably only) selling point of scoped_*, move_* and auto_* is
that they have no size overhead, i.e. sizeof(scoped_*<T>) == sizeof(T*).
Everything else is covered by std::vector reasonably well. boost::array is
statically allocated, it doesn't count.

It is possible (in theory) to get std::vector's size down to a single
pointer, too, but no standard library implementation does that. If this were
the norm, the alternative arrays would have had a hard time justifying their
existence. :-)


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