Ensuring Proper Cleanup in the Case of an Uncaught Exception
It is implementation-dependent whether the destructors of local objects are invoked when an uncaught exception occurs. To ensure that destructors of local objects are invoked in this case, you can