#include <memory>
#include <iostream>

using namespace std;

class Exception{};

class Form
{
public:
	Form()
	{
		cout << "constructing" << endl;
	}
	~Form()
	{
		cout << "destructing" << endl;
	}
};

int f()
{
	auto_ptr<Form> f (new Form);
	auto_ptr<Form> n (f);
	Form * m = n.get();
	throw Exception();
}

int main ()
{
	try {
		f();
	} catch (Exception e)
	{
		cout << "catched exception" << endl;
	}
	return 0;
}


