On Mon, Sep 16, 2013 at 5:12 AM, Jonathan Wakely
On 9 September 2013 22:57, Niall Douglas wrote:
On 9 Sep 2013 at 13:11, Nevin Liber wrote: The problem is that unless some code is specifically marked as noexcept, you have to assume it can throw, and as destructors ought to be noexcept, that means lots of try...catch verbiage. I disagree that littering destructors with try-catch is best practice.
Littering your code with throwing destructors is not the best practice, either. The simple rule to follow is: don't ever throw in destructors. In practice this means that destructors should free resources and do nothing else. That way you don't litter destructors with try catch(...), you use this only as a last resort means to prevent a destructor from throwing. -- Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode