Boost logo

Boost :

From: Darin Adler (darin_at_[hidden])
Date: 2001-10-18 23:37:33


on 10/18/01 7:08 PM, David Abrahams at david.abrahams_at_[hidden] wrote:

> IMO it's not even a question of self-assignment. I would prefer to detect
> calls to "reset" on a pointer that is already managed by another smart
> pointer whenever possible, by asserting.

I agree that's highly desirable. But it seems to point in a different
direction from the existing feature.

The feature in reset() now gives predictable behavior when doing a reset to
the same pointer twice. It doesn't prohibit it. I just wanted to point out
that Peter's revision of smart_ptr removes this feature.

Changing the existing check to an assert, simple or sophisticated, that
makes this illegal would be OK for me, but maybe not for others.

    -- Darin


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