20 General utilities library [utilities]

20.11 Smart pointers [smartptr]

20.11.1 Class template unique_ptr [unique.ptr]

20.11.1.3 unique_ptr for array objects with a runtime length [unique.ptr.runtime]

20.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 ]