#include <iostream>
#include <string>
using namespace std;
class AAA {
private:
const string strName;
public:
AAA(const string& strName) : strName(strName) {
cout << "AAA() call - " << this->strName << endl;
}
~AAA() { cout << "~AAA() call - " << this->strName << endl; }
};
void func1();
void func2();
void func3();
void func1() {
AAA aaa("func1");
func2();
}
void func2() {
AAA aaa("func2");
func3();
}
void func3() {
AAA aaa("func3");
throw 10;
}
int main() {
try {
func1();
} catch (int& iEx) {
cout << "main catch int" << endl;
}
return 0;
}