Boost logo

Boost :

From: Jeff Flinn (TriumphSprint2000_at_[hidden])
Date: 2004-01-22 08:12:53


"Bronek Kozicki" <brok_at_[hidden]> wrote in message
news:hirnb438f819.1038t73lzwwe6$.dlg_at_40tude.net...
> On Wed, 21 Jan 2004 10:58:32 -0500, Howard Hinnant wrote:
>
> > template<class T, class D>
> > class move_ptr<T[], D>
> > {
> > public:
> > T& operator[](size_t i) const;
>
> I think that interface of this class should be similar to standard
> container, ie. I'd like to iterate through its elements using begin() -
> end() functions etc.

This triggered a thought.

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

Do xxxx_ptr< std::vector<T> > and xxxx_ptr< boost::array<T,N> > cover all
use cases.

Are the latter safer, clearer and just as efficient as the former?

The boost Guidelines says:

"Use the C++ Standard Library or other Boost libraries, but only when the
benefits outweigh the costs. Do not use libraries other than the C++
Standard Library or Boost. See Library reuse. "

Thoughts?

-----------------
Jeff Flinn
Applied Dynamics, International


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