std::unique_ptr array specialization

How come it works without being given the deleter?
The second template parameter, Deleter, isn't defaulted.

http://en.cppreference.com/w/cpp/memory/unique_ptr
> The second template parameter, Deleter, isn't defaulted.

It is.

// 20.7.1 class template unique_ptr:
template <class T> class default_delete;
template <class T> class default_delete<T[]>;
template <class T, class D = default_delete<T>> class unique_ptr;
template <class T, class D> class unique_ptr<T[], D>;


In conjuction with:
The template arguments of a specialization are deduced from the arguments of the primary template.

And:
The template parameter list of a specialization shall not contain default template argument values.
Footnote: There is no way in which they could be used.
Topic archived. No new replies allowed.