C++中的make_shared,shared_ptr与weak_ptr_c++ make_weak-CSDN博客

网站介绍:文章浏览阅读3.4k次。C++中的make_shared,shared_ptr与weak_ptrC++11中引入了智能指针,同时还有一个模板函数std::make_shared可以返回一个指定类型的std::shared_ptr。shared_ptr的基本操作#include <memory>#include <iostream>struct Foo { Foo() ..._c++ make_weak