Enquiring minds want to know: Why use unique_ptr<T[]>
vs. vector<T>
vs. array<T>
?
Is there any use for unique_ptr with array?
std::unique_ptr
has support for arrays, for instance:
std::unique_ptr<int[]> p(new int[10]);but is it needed? probably it is more convenient to use
std::vector
orstd::array
.Do you find any use for that construct?
Add a Comment
Comments are closed.