4 ms·
> although it will still be missing make_unique<T[]> This is not true -- see §20.9.1.4 of the C++14 draft [1]. make_unique is defined for array types with unkn
by pbsd 12y ago
> although it will still be missing make_unique<T[]>
This is not true -- see §20.9.1.4 of the C++14 draft [1]. make_unique is defined for array types with unknown bound (i.e., T[]), but it is deleted for array types of known bound (e.g., T[5]). So to make an array of 100 default-initialized `int`s,
auto array = std::make_unique<int[]>(100);
[1] http://isocpp.org/files/papers/N3690.pdf http://isocpp.org/files/papers/N3690.pdf