c++智能指针

c++智能指针 c++11之前的auto_ptr; c++11新加的unique_ptr, shared_ptr以及weak_ptr。 头文件:#include <memory> 1.auto_ptr     std::auto_ptr是我第一个看的智能指针,也是标准库里的智能指针,有许多缺陷。 使用方式:  auto const ptr = std::auto_ptr<int>(new int)
相关文章
相关标签/搜索