#include <iostream>
#include <vector>
using namespace std;
class MyObj
{
	public:
	int a;
	int b;

	MyObj( int ai, int bi )
	{
   		cout << "constructor of "<<this << endl;
    	this->a = ai;
    	this->b = bi;
	}

	MyObj(const MyObj& other)  // copy constructor
	{
		cout<<"copy constructor of " <<this<<endl;
	}
	
	~MyObj()
	{
		cout<<"destructor of "<<this<<endl;
	}

  
};

vector<MyObj> myVec;

void foo()
{
    MyObj objInst( 10, 20 );
    myVec.push_back( objInst );
}

int main() {
	cout << "main start" <<endl;
	foo();
	cout << "main end"<<endl;

	return 0;
}