Boost logo

Boost :

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

"Bronek Kozicki" <brok_at_[hidden]> wrote in message
> 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. "


Jeff Flinn
Applied Dynamics, International

Boost list run by bdawes at, gregod at, cpdaniel at, john at