std::terminate
来自cppreference.com
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
在头文件 <exception> 中定义
|
||
[[noreturn]] void terminate(); |
||
std::terminate()
被称为C + +运行时异常处理以下的任何原因而失败原文:
std::terminate()
is called by the C++ runtime when exception handling fails for any of the following reasons:抛出一个异常,而不是抓住(这是实现定义是否是在这种情况下,任何堆栈展开)
2) 原文:
an exception is thrown and not caught (it is implementation-defined whether any stack unwinding is done in this case)
在异常处理过程中抛出一个异常(例如,从一些本地对象的析构函数,或从功能,被称为异常处理过程中)
3) 原文:
an exception is thrown during exception handling (e.g. from a destructor of some local object, or from a function that had to be called during exception handling)
静态或本地线程对象的构造函数或析构函数抛出一个异常
4) 原文:
the constructor or the destructor of a static or thread-local object throws an exception
注册的功能与std::atexit或std::at_quick_exit抛出一个异常
5) 原文:
a function registered with std::atexit or std::at_quick_exit throws an exception
一个noexcept规范被侵犯(这是实现定义是否是在这种情况下,任何堆栈展开)
6) 原文:
a noexcept规范 is violated (it is implementation-defined whether any stack unwinding is done in this case)
一个动态异常规范被侵犯的默认处理std::unexpected执行
7) 原文:
a 动态异常规范 is violated and the default handler for std::unexpected is executed
一个非默认的处理程序std::unexpected抛出一个异常,违反了先前违反的动态异常规范,如果规范不包括std::bad_exception
8) 原文:
a non-default handler for std::unexpected throws an exception that violates the previously violated dynamic exception specification, if the specification does not include std::bad_exception
std::nested_exception::rethrow_nested呼吁的对象,未持有捕获的异常
9) 原文:
std::nested_exception::rethrow_nested is called for an object that isn't holding a captured exception
从最初的功能,std::thread抛出一个异常
10) 原文:
an exception is thrown from the initial function of std::thread
被摧毁或分配到一个可连接std::thread
原文:
a joinable std::thread is destroyed or assigned to
std::terminate()
也可以直接从程序中调用.原文:
std::terminate()
may also be called directly from the program.
在任何情况下,
std::terminate
调用当前安装的std::terminate_handler。默认std::terminate_handler调用std::abort.原文:
In any case,
std::terminate
calls the currently installed std::terminate_handler. The default std::terminate_handler calls std::abort.
目录 |
[编辑] 参数
(无)
[编辑] 返回值
(无)
[编辑] 例外
[编辑] 另请参阅
std::terminate所调用的函数的类型的 原文: the type of the function called by std::terminate (typedef) |