指示对象想要获取另一个对象的所有权的最佳方法是什么?到目前为止,我一直std::auto_ptr在公共接口中使用a ,因此客户端知道接口想要获取传递对象的所有权.
std::auto_ptr
但是,最新的GCC告诉我auto_ptr已被弃用,所以我想知道推荐什么?boost::interprocess::unique_pointer看起来像个好人,但这真的是最好的解决方案吗?
auto_ptr
boost::interprocess::unique_pointer
c++
c++ ×1