
boost::shared_ptr是可以共享所有权的指针。如果有多个shared_ptr共同管理同一个对象时,只有这些shared_ptr全部与该对象脱离关系之后,被管理的对象才会被释放。
使用一般配合boost:make_shared使用:
boost::shared_ptr
或者用auto自动类型推断
auto realTimePressure = boost::make_shared(_zForce);
https://blog.csdn.net/dddxxxx/article/details/87929470
https://blog.csdn.net/rain_qingtian/article/details/12005201
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)