【问题标题】:Are there boost make_shared_array and make_scope or only make_shared?是否有 boost make_shared_array 和 make_scope 或只有 make_shared?
【发布时间】:2013-02-05 11:37:57
【问题描述】:

是否有提升make_shared_arraymake_scope_ptr 或只有make_shared

【问题讨论】:

    标签: c++ boost c++03


    【解决方案1】:

    boost::make_scoped_ptr 不起作用,因为您无法从scoped_ptr 转移所有权。至少,没有明确调用swap

    对于 Boost 1.53,没有太多理由使用 shared_array,因为您可以将 shared_ptr 与数组类型一起使用。所以只需使用boost::make_shared

    【讨论】:

      猜你喜欢
      • 2012-10-07
      • 2011-07-22
      • 1970-01-01
      • 2011-01-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-10
      相关资源
      最近更新 更多