Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2001-10-22 08:46:27


At 09:37 PM 10/18/01 -0700, Darin Adler wrote:
>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.

I'd also support adding adding such a precondition, with an assert().

--Beman


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