Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-10-18 21:08:45


----- Original Message -----
From: "Peter Dimov" <pdimov_at_[hidden]>
> From: "Darin Adler" <darin_at_[hidden]>
> > Things in there that I am not sure we want:
> >
> > i) removal of "self assignment" feature of reset member -- it's a
> > strange feature, but I'm not sure we should remove it
>
> I don't see 'self assignment' as a feature, but if it's deemed essential,
it
> would be trivial to add.
>
> Note, however, that in the case where shared_ptr accepts a finalizer,
> reset() is not a no-op in the self-assignment case, since it reverts to
the
> default 'delete px' finalizer.

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.

===================================================
  David Abrahams, C++ library designer for hire
 resume: http://users.rcn.com/abrahams/resume.html

        C++ Booster (http://www.boost.org)
          email: david.abrahams_at_[hidden]
===================================================


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