How do smart pointers handle arrays? For example,
void function(void) { std::unique_ptr my_array(new int[5]); }
When m
m
It will call delete[] and hence the entire array will be reclaimed but I believe you need to indicate that you are using an array form of unique_ptrby:
delete[]
unique_ptr
std::unique_ptr my_array(new int[5]);
This is called as Partial Specialization of the unique_ptr.