C++11
c++98 auto_ptr
c++11 scoped_ptr unique_ptr weak_ptr
scoped_ptr(boost), unique_ptr(c++11) 防拷贝
shared_ptr(boost/c++11)
unique_ptr<type> p;
unique_ptr 唯一拥有 所指向的内存。
拷贝构造函数
移动构造函数
shared_ptr
weak_ptr
C++11
c++98 auto_ptr
c++11 scoped_ptr unique_ptr weak_ptr
scoped_ptr(boost), unique_ptr(c++11) 防拷贝
shared_ptr(boost/c++11)
unique_ptr<type> p;
unique_ptr 唯一拥有 所指向的内存。
拷贝构造函数
移动构造函数
shared_ptr
weak_ptr