#include using namespace std; class X { public: X() { cout << "CONSTR" << endl; } X(const X &x) { cout << "COPY" << endl; } X &operator=(const X &x) { cout << "ASSIGN" << endl; return *this; } ~X() { cout << "DESTR" << endl; } }; void g(X x) { cout << "g" << endl; } int main() { X u; cout << "AAA" << endl; X v(u); cout << "BBB" << endl; X w = v; cout << "CCC" << endl; v = u; cout << "DDD" << endl; g(v); cout << "EEE" << endl; }