3 ms·
A simple new int[] will work. It doesn't initialize the array (unlike the new int[]() version). You can use it with std::unique_ptr<> to simplify memory manage
by andreyv 10y ago
A simple new int[] will work. It doesn't initialize the array (unlike the new int[]() version).
You can use it with std::unique_ptr<> to simplify memory management.
- SeanBoocock 10y agoThis is true but at least with the current standard you will want to define a custom deleter with your unique_ptr to implement "delete [] data" vs the default behavior of "delete data".