cpp 基础
崖间松
用无穷的毅力去追逐自己的梦想
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
智能指针shared_ptr 的简单实现
#includeusing namespace std;class U_Ptr{friend class HasPtr;int *ip;size_t use;U_Ptr(int *p) :ip(p), use(1){cout }~U_Ptr(){delete ip;cout }};class Has原创 2016-06-09 13:25:29 · 718 阅读 · 0 评论 -
弱引用weak_ptr 解决shared_ptr的循环引用
shared_ptr 的问题原创 2016-11-07 10:39:36 · 6673 阅读 · 0 评论 -
enable_shared_from_this 的使用及原理
template<class T> class enable_shared_from_this{protected: enable_shared_from_this() { } enable_shared_from_this(enable_shared_from_this const &) { } enable_shared_from_this转载 2016-11-07 21:08:15 · 551 阅读 · 0 评论
分享