#include <iostream>
using namespace std;

struct tmp {
	int i;
	const int *get_i() const { return &i; }
	tmp() : i(42) {}
	~tmp() { cout << "tmp destroyed" << endl; }
};

tmp gettmp()
{
  tmp t;
  return t;
}

int main() {
	cout << "Begin" << endl;
	const tmp &t = gettmp();
	const int *i = t.get_i();
	cout << "end" << endl;

	cout << "[Happy] i is still alive : " << *i  << endl;
	
	return 0;
}