首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

VC对错误规范的处理不符合标准吗?

2012-04-08 
VC对异常规范的处理不符合标准吗??书上说的如果抛出一个不再异常规范中指定的异常,则调用unexpected函数,

VC对异常规范的处理不符合标准吗??
书上说的如果抛出一个不再异常规范中指定的异常,则调用unexpected函数,但是貌似我试了一下,啥事都没有,还是直接抛出了那个不再规范中指定的异常,程序继续!!!
求解释

[解决办法]
The function calls the current unexpected handler, a function of type void () called when control leaves a function by a thrown exception of a type not permitted by an exception specification for the function, as in:

void f() throw() // function may throw no exceptions
{throw "bad"; } // unexpected throw calls unexpected()
An unexpected handler may not return to its caller. It may terminate execution by:

Throwing an object of a type listed in the exception specification. 
Throwing an object of type bad_exception. 
Calling terminate(), abort(), or exit(int). 

[解决办法]
没必要支持。
现在C++界的普遍观点就是:不要使用异常规格说明语法。
[解决办法]
个人觉得VC中有很多地方和标准的C++不同
[解决办法]
有时候要用SEH的!

热点排行