Boost logo

Boost Users :

Subject: Re: [Boost-users] how to help an object to delete itself the boost way
From: Chris Cleeland (chris.cleeland_at_[hidden])
Date: 2015-12-17 15:43:45


On Thu, Dec 17, 2015 at 1:38 PM, Ian Bruntlett <ian.bruntlett_at_[hidden]>
wrote:

>
> If a member function finishes the job and frees the resources, have that
> member function modify the object's member variables so the destructor can
> recognise that the resources have been freed and it doesn't need to do
> anything about those resources.
>
> This approach is called RAII and see this page:-
> https://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization
>

"delete this" sounds more like Resource Suicide and not RAII.

-- 
Chris Cleeland


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net