share_ptr 与enable_shared_from_this-CSDN博客网友收藏

share_ptr 与enable_shared_from_this-CSDN博客

enable_shared_from_this,是一个以其派生类为模板类型实参的基础模板,继承它,this指针就能变成shared_ptr。什么时候该使用enable_shared_from_this模板类 在看下面的例子之前,简单说下使用背景,单有一个类,某个函数需要返回当......
阅读全文