example
1 class Test 2 { 3 public: 4 Test() { cout << "construct" << endl; } 5 ~Test() { cout << "destruct" << endl; } 6 }; 7 8 int main() 9 { 10 Test t1; 11 { 12 Test& t2 = t1; 13 } 14 cout << "............................." << endl; 15 return 0; 16 }
结果: