我问的不是意想不到的异常,而是没有捕获到的异常。
崩溃了?还是终止了?
最佳答案
根据§15.3/9:
If no matching handler is found in a program, the function terminate() is called; whether or not the stack is unwound before this call to terminate() is implementation-defined (15.5.1). Emphasis mine
之后会发生什么取决于您的操作系统。在实践中:崩溃。 (或者如果你在调试器中,“嘿,你没听清楚。”)
关于c++ - 如果未捕获异常会发生什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2633193/