While reading Herb Sutter's More Exceptional C ++, I came across the following code:
T::Close()
{
}
T::~T()
{
try
{
Close();
}
catch( ... ) { }
}
My understanding was, this is not a good idea. Because, if T destructor is called during the expansion of the stack due to an exception, and then Close () throws an exception, it will call the Terminate () call.
Can someone shed some light on this. Thanks in advance.
source
share