std::unique_ptr 支持数组,例如:
std::unique_ptr
std::unique_ptr<int[]> p(new int[10]);
但它需要吗?可能使用std::vector或更方便std::array.
std::vector
std::array
你觉得这个结构有用吗?
c++ smart-pointers c++11
c++ ×1
c++11 ×1
smart-pointers ×1