#include<iostream>
#include<exception>
using namespace std;
//测试意外异常
void myUnexpected()
{
throw bad_exception();
}
void Test() throw(out_of_range,bad_exception)
{
throw logic_error("i love");
}
int main()
{
set_unexpected(myUnexpected);
try {
Test();
}
catch (out_of_range& ex) {
exit(5);
}
catch (bad_exception& ex) {
cout << "Oop";
}
}