smart_pointer
MSDN参考 https://msdn.microsoft.com/zh-cn/library/hh279674.aspx
unique_ptr :只允许一个拥有者,已删除复制 等 来禁止这些操作,转移owner 用std::move,用来替代auto_ptr
{
std::unique_ptr<A> ptr(new A);
ptr.get();
std::unique_ptr<A> qa;
cout << __FUNCTION__ << endl;
qa = std::move(ptr); //转移owner
ptr.reset();
cout << __FUNCTION__ << endl;
}
cout << __FUNCTION__ << endl;