#include <iostream>
using namespace std;
class A
{
string name;
public:
A(string n)
{
name = n;
cout<<"constructor: "<<name.c_str()<<endl;
}
A(const A& x)
{
cout<<"copy constructor: "<<name.c_str()<<endl;
}
A& operator=(const A& x)
{
cout<<"copy assignment: "<<name.c_str()<<endl;
return *this;
}
static A g(A x)
{
cout<<"in function g"<<endl;
A a("a");
return x;
}
};
int main()
{
A a1("a1");
A a2=a1;
A a3("a3");
a2 = a3;
A a4 = A::g(a2);
}