Boost logo

Boost :

From: Thomas Witt (witt_at_[hidden])
Date: 2002-09-09 14:38:36


Peter,

On Monday 09 September 2002 19:37, Peter Dimov wrote:
> From: "Thomas Witt" <witt_at_[hidden]>
>
> Another indication that you can't beat copy+swap correctness-wise.

That's exactly what I thought as I discovered the problem. BTW there is
another lesson I've learned about intrusive ptrs. Creating the A object in
B's ctor like this:

B::B()
{
  shared_ptr<B> self(intrusive_ptr(this));

  a_.reset(new A(self));
}

is a very bad idea.

> OK, I've
> fixed scoped_ptr::reset (although I've some trouble communicating with the
> CVS server so the changes aren't committed yet.)

Thanks!

> The self-reset "feature"
> is still there; should we remove it as well for 1.29 or can this wait?

I am not religous about this one. Actually I think Beman has a point. reset()
should be allowed if ptr == 0. What about

BOOST_ASSERT( !ptr || ptr != p);

What did I miss this time?

--Thomas

-- 
Dipl.-Ing. Thomas Witt
Institut fuer Verkehrswesen, Eisenbahnbau und -betrieb, Universitaet Hannover
voice: +49(0) 511 762 - 4273, fax: +49(0) 511 762-3001
http://www.ive.uni-hannover.de

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