只是一个小问题shared_ptr.
shared_ptr
使用shared_ptr指向数组是一个好习惯吗?例如,
shared_ptr<int> sp(new int[10]);
如果没有,那么为什么不呢?我已经意识到的一个原因是不能增加/减少shared_ptr.因此,它不能像正常指向数组的指针一样使用.
c++ shared-ptr c++11
c++ ×1
c++11 ×1
shared-ptr ×1