Boost logo

Boost :

From: Darin Adler (darin_at_[hidden])
Date: 2001-10-19 10:58:31


on 10/19/01 3:48 AM, Peter Dimov at pdimov_at_[hidden] wrote:

> I do know that the motivation for the self-reset is that std::auto_ptr
> supports it, but I would strongly suggest that we reconsider propagating the
> same mistake into shared_ptr.

I think that the best short term solution is to replace:

    if (px == p) return;

with:

    assert(p == 0 || p != px); // no auto_ptr-style self-reset "feature"

I think an assert that catches the specific case that is legal with older
versions of shared_ptr and with auto_ptr is good, even though there are tons
of other kinds of misuse that it won't catch.

What do you think?

    -- Darin


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