会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
首页
新随笔
管理
订阅
2021年6月26日
shared_from_this
摘要: 1. 介绍 关于智能指针 shared_ptr 很有意思的一个问题。 可以用 std::shared_ptr 将裸指针封装起来,变成带引用计数的智能指针,当引用计数为0,C++会自动把裸指针指向的内存回收。 先定义一个类 class A { public: A(); private: int a_;
阅读全文
posted @ 2021-06-26 23:39 suntus
阅读(529)
评论(0)
推荐(0)
编辑
公告