Boost logo

Boost :

From: Bill Klein (bill_at_[hidden])
Date: 2001-03-23 10:13:08

> > Just wanted to know what the reason was for leaving out a swap()
> > for scoped_ptr and scoped_array (it's included in the shared
> > variety).

Beman wrote:
> Scoped_ptr is a KISS class - you use it when you want a very simple
> solution, but use something else (shared_ptr, auto_ptr) if you
> needs are greater.
> Did you have a specific problem you were trying to solve, or was it
> a general question?

I have a class that has member of type scoped_array<> to handle some
memory I allocate... The crux of the situation is that I'd like to
implement a non-throwing swap() for my class (for other reasons), and
to do this, the scoped_array<> would need a swap(). shared_array is
overkill in this situation, but of course I can roll my own that
does what I need... Just thought this might be a common desire,
although I do understand the drive to keep it as simple as possible.

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