智能指针如何处理数组?例如,
void function(void) { std::unique_ptr<int> my_array(new int[5]); }
当my_array超出范围并被破坏时,整个整数数组是否会被重新声明?只回收了数组中的第一个元素吗?或者还有其他事情发生(例如未定义的行为)?
my_array
c++ smart-pointers c++11
c++ ×1
c++11 ×1
smart-pointers ×1