23 General utilities library [utilities]

23.11 Smart pointers [smartptr]

23.11.1 Class template unique_­ptr [unique.ptr]

23.11.1.3 unique_­ptr for array objects with a runtime length [unique.ptr.runtime]

23.11.1.3.2 unique_­ptr assignment [unique.ptr.runtime.asgn]

template <class U, class E> unique_ptr& operator=(unique_ptr<U, E>&& u)noexcept;
This operator behaves the same as in the primary template, except that it shall not participate in overload resolution unless all of the following conditions hold, where UP is unique_­ptr<U, E>:
  • U is an array type, and
  • pointer is the same type as element_­type*, and
  • UP​::​pointer is the same type as UP​::​element_­type*, and
  • UP​::​element_­type(*)[] is convertible to element_­type(*)[], and
  • is_­assignable_­v<D&, E&&> is true.
[ Note
:
This replaces the overload-resolution specification of the primary template
— end note
 ]