1. 要使用C++ 11以上版本
2. 要包含下面的头文件
error: ‘shared_ptr‘ was not declared in this scope_追梦-北极星的博客
3. 测试代码
1. 要使用C++ 11以上版本
2. 要包含下面的头文件
error: ‘shared_ptr‘ was not declared in this scope_追梦-北极星的博客
3. 测试代码
总结1. reset(),参数为空时,会释放shared_ptr所拥有的对象,释放后执行get()会返回fal
前言智能指针是行为类似于指针的类对象,单这种对象还有其他功能。本文介绍三个可帮助管理动态
文章目录1.unique_ptr特点2.unique_ptr例子3.unique_ptr总结4.shared_ptr特点5.shar
三、若是定义在class中,则需要在class的构造函数中。一、使用shared_ptr条件。
_pt...
shared_ptr智能指针
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M