#include <iostream>
using namespace std;

class A
{
public:
	A() { cout << "A constructor" << endl; }
	A(const A& a) { cout << "A copy constructor" << endl; }
	~A() { cout << "A destructor" << endl; }
};

A ACreator()
{
	cout << "Creating a on stack" << endl;
	A res = A();
	cout << "Returning a" << endl;
	return res;
}

void Test()
{
	cout << "Calling ACreator() to get some A" << endl;
	A a = ACreator();
	A copy = a;
	cout << "Got some a" << endl;
}

int main() {
	cout << "Calling Test()" << endl;
	Test();
	cout << "Test ended. Returning 0" << endl;
	return 0;
}