[unique.ptr.runtime.asgn]

# 20 Memory management library [[mem]](./#mem)

## 20.3 Smart pointers [[smartptr]](smartptr#unique.ptr.runtime.asgn)

### 20.3.1 Unique-ownership pointers [[unique.ptr]](unique.ptr#runtime.asgn)

#### 20.3.1.4 unique_ptr for array objects with a runtime length [[unique.ptr.runtime]](unique.ptr.runtime#asgn)

#### 20.3.1.4.3 Assignment [unique.ptr.runtime.asgn]

[ð](#lib:operator=,unique_ptr)

`template<class U, class E> constexpr unique_ptr& operator=(unique_ptr<U, E>&& u) noexcept;
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/memory.tex#L3059)

This operator behaves the same as in the primary template[.](#1.sentence-1)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/memory.tex#L3062)

*Constraints*: Where UP is unique_ptr<U, E>:

- [(2.1)](#2.1)

U is an array type, and

- [(2.2)](#2.2)

pointer is the same type as element_type*, and

- [(2.3)](#2.3)

UP​::​pointer is the same type as UP​::​element_type*, and

- [(2.4)](#2.4)

UP​::​element_type(*)[] is convertible to element_type(*)[], and

- [(2.5)](#2.5)

is_assignable_v<D&, E&&> is true[.](#2.sentence-1)

[*Note [1](#note-1)*:

This replaces the *Constraints*: specification of the primary template[.](#2.sentence-2)

â *end note*]
