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).
晕,刚去MSDN看了下
发现如下文字:
The C++ Standard requires that unexpected is called when a function throws an exception that is not on its throw list. The current implementation does not support this. The example calls unexpected directly, which calls the unexpected handler.