Boost logo

Boost :

Subject: Re: [boost] [C++11] If you have an old class with a throwing destructor...
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2013-09-16 03:08:29


On Sun, Sep 15, 2013 at 11:20 PM, Nathan Ridge <zeratul976_at_[hidden]> wrote:
>> On 13-09-09 02:57 PM, Niall Douglas wrote:
>>> On 9 Sep 2013 at 13:11, Nevin Liber wrote:
>>>
>>>>> In C++03 it was always best practice to *always* wrap your
>>>>> destructors in a try...catch clause.
>>>>
>>>> No; the best practice is not to throw from a destructor.
>>>
>>> Sorry, my unclear phrasing again ... by wrapping destructors I
>>> specifically meant:
>>>
>>> destructor::~destructor()
>>> { try {
>>> ...
>>> } catch(...) { /* do something useful */ } }
>>
>> Can you elaborate on what "something useful" is in this context?
>
> Log the error, perhaps?

I'd log it in /dev/null. :)

--
Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode

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