使用方法:

unique_ptr<string> ps1(new string("hello")); 
shared_ptr<vector<int>> ps2(new vector<int>(3));  //(*ps2).size() = 3;
weak_ptr <vector<int>> ps5(ps2), ps6;   //初始化weak_ptr的方法
ps6 = ps2;
auto ps4 = make_shared<int>(5);           //ps4的类型为 shared_ptr<int>

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-03
  • 2021-08-31
  • 2022-03-10
  • 2022-12-23
  • 2022-01-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-05
  • 2021-11-10
  • 2021-08-27
  • 2021-09-01
相关资源
相似解决方案