右值引用避免深拷貝

問題代碼:c++ class A { public: A() : m_ptr(new int(0)) { cout << "construct" << endl; } A(const A& a) : m_ptr(new int(*a.m_ptr)) { cout << "copy construct" << endl; } ~A() { cout << "destr
相關文章
相關標籤/搜索