Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有提升make_shared_array和make_scope_ptr或只有make_shared?
make_shared_array
make_scope_ptr
make_shared
boost::make_scoped_ptr行不通,因为您无法从scoped_ptr. 至少,不是没有明确调用swap.
boost::make_scoped_ptr
scoped_ptr
swap
而对于 Boost 1.53,没有太多理由使用shared_array,因为您可以只使用shared_ptr数组类型。所以只需使用boost::make_shared.
shared_array
shared_ptr
boost::make_shared