Boost logo

Boost :

Subject: Re: [boost] [valid_ptr] proposing a new type of pointer object that allows validity tracking without memory management and object ownership
From: Peter Dimov (pdimov_at_[hidden])
Date: 2011-03-16 22:15:51


Dan Walters wrote:
> I do not understand your comment about f() indirectly causing the
> object to be destroyed, could you explain this a little more? if f()
> is a member function, surely that would involve the line "delete
> this;" ? I am missing something...

It's rarely as direct as "delete this"; the chain is usually more
convoluted, f.ex. p->f() calls g() which calls h() which happens to replace
the contents of a container that owns the object.


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