c++ Boost智能指针shard

c++ Boost智能指针shard,第1张

c++ Boost智能指针shard

boost::shared_ptr是可以共享所有权的指针。如果有多个shared_ptr共同管理同一个对象时,只有这些shared_ptr全部与该对象脱离关系之后,被管理的对象才会被释放。

使用

一般配合boost:make_shared使用:
boost::shared_ptr outputValue = boost::make_shared(poses);

或者用auto自动类型推断
auto realTimePressure = boost::make_shared(_zForce);

参考

https://blog.csdn.net/dddxxxx/article/details/87929470
https://blog.csdn.net/rain_qingtian/article/details/12005201

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5116080.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-11-17
下一篇2022-11-17

发表评论

登录后才能评论

评论列表(0条)

    保存