有没有办法确定是否发生了异常?

1 c++ destructor exception-handling exception

在析构函数中,有没有办法确定当前是否正在处理异常?

Luc*_*lle 7

您可以使用std :: uncaught_exception(),但它可能不会按照您的想法执行操作:有关详细信息,请参阅GoTW#47.