boost::shared_ptr是可以共享所有权的指针。如果有多个shared_ptr共同管理同一个对象时,只有这些shared_ptr全部与该对象脱离关系之后,被管理的对象才会被释放。
使用
一般配合boost:make_shared使用:
boost::shared_ptr<std::vectorEigen::Isometry3d> outputValue = boost::make_shared<std::vectorEigen::Isometry3d>(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