摘要: boost::scoped_ptr虽然简单易用,但它不能共享所有权的特性却大大限制了其使用范围,而boost::shared_ptr可以解决这一局限。顾名思义,boost::shared_ptr是可以共享所有权的智能指针,首先让我们通过一个例子看看它的基本用法:#include <string>#include <iostream>#include <boost/shared_ptr.hpp>class implementation{public:~implementation() { std::cout <<"destroying i 阅读全文
posted @ 2011-12-15 16:40 rookieeeeee 阅读(1611) 评论(0) 推荐(0) 编辑