deduction_guides.h — deduction guides with some helper metafunctions.
test.cpp — compile time tests.
- New customization point
template<class> constexpr bool deleter_applicable_to_array
introduced. By default it is equal totrue
fordefault_delete<T[]>
and is equal tofalse
for everything else. It is necessary for deducing first template argument ofunique_ptr
asT[]
. Possible alternative is to require from deleters inner typedefapplicable_to_array
(similarly tois_transparent
for comparators). - Deleter type is never deduced as a reference except for function types.
- For the deduced type
UP
following invariant holds- type
UP::deleter_type::pointer
is ill formed or is_same<UP::element_type, pointer_traits<UP::deleter_type::pointer>::element_type
>.
- type