Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-09-25 08:05:26

From: "Greg Colvin" <Gregory.Colvin_at_[hidden]>
> At 05:51 PM 9/24/2002, you wrote:
> >...
> >
> >Me too. I'm a big fan of scoped_ptr. Making it "more powerful" will make
it less useful.
> Yep. I don't even like it having reset.

Finding the right balance between simplicity and features is always
difficult. I like Greg's scoped_ptr motto "as safe as possible but no
safer." swap() or reset() (reset is a syntactic sugar given a swap) don't
make scoped_ptr any more unsafe. I can't bring myself to view swap() as some
kind of "transfer loophole", and swapless classes are quite annoying at
times. :-)

How often have you used std::vector::swap() to "transfer ownership" to
another vector? Most people don't even realize that this is possible!

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