使用Boost库中的组件进行C++内存管理
分类: Boost学习2013-07-14
15:28 111人阅读 评论(0) 收藏 举报
目录(?)[+]
C++标准库中的auto_ptr,智能指针,部分的解决了获取资源自动释放的问题
在Boost中,提供了6中智能指针:scoped_ptr, scoped_array, shared_ptr, shared_array, weak_ptr, instrusive_ptt,这些智能指针属于smart_ptr组件
使用时: #include <boost/smart_ptr.hpp> using namespace std;
接下来介绍前四个智能指针
scoped_ptr
类部分摘抄
[cpp] view
plaincopy
template<class T&g......
阅读全文