longjmp
来自cppreference.com
|
|
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
| 在头文件 <setjmp.h> 中定义
|
||
| void longjmp( jmp_buf env, int status ); |
||
加载的执行上下文
env保存以前调用setjmp的。这个函数不返回。控制权转移到宏观setjmp成立env的调用点。这setjmp然后返回值,通过为status.原文:
Loads the execution context
env saved by a previous call to setjmp. This function does not return. Control is transferred to the call site of the macro setjmp that set up env. That setjmp then returns the value, passed as the status.如果是调用该函数setjmp已退出,其行为是不确定的(换句话说,只允许调用堆栈向上跳跃)
原文:
If the function that called setjmp has exited, the behavior is undefined (in other words, only long jumps up the call stack are allowed)
没有自动对象的析构函数被调用。如果更换的
longjmpthrow和setjmpcatch将执行一个不平凡的任何自动对象的析构函数,这样longjmp的行为是未定义的.原文:
No destructors for automatic objects are called. If replacing of
longjmp with throw and setjmp with catch would execute a non-trivial destructor for any automatic object, the behavior of such longjmp is undefined.目录 |
[编辑] 参数
| env | - | 变量setjmp保存的程序执行状态
原文: variable referring to the execution state of the program saved by setjmp |
| status | - | 返回的值setjmp。如果它是等于0,1代替
原文: the value to return from setjmp. If it is equal to 0, 1 is used instead |
[编辑] 返回值
(无)
[编辑] 示例
| 本章尚未完成 原因:暂无示例 |
[编辑] 另请参阅
| 保存上下文 (函数宏) | |
| C++ documentation for longjmp
| |