#include <iostream>
using namespace std;

class A
{
public:
    A(){ cout<<"A()"<<endl; }
    ~A(){ cout<<"~A()"<<endl; }
};
void func()
{
    A a;
    cout<<"throw int exception."<<endl;
    throw 43;//"栈反解"并清理临时对象a.
    cout<<"throw is failure"<<endl;
}
int main()
{
    try{
        cout<<"try begin"<<endl;
        func();
    }
    catch(int)
    {
        cout<<"catch begin"<<endl;
    }
    return 0;
}

