[container.node.cons]

# 23 Containers library [[containers]](./#containers)

## 23.2 Requirements [[container.requirements]](container.requirements#container.node.cons)

### 23.2.5 Node handles [[container.node]](container.node#cons)

#### 23.2.5.2 Constructors, copy, and assignment [container.node.cons]

[ð](#itemdecl:1)

`constexpr node-handle(node-handle&& nh) noexcept;
`

[1](#1)

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

*Effects*: Constructs a *node-handle* object initializingptr_ with nh.ptr_[.](#1.sentence-1)

Move constructs alloc_ withnh.alloc_[.](#1.sentence-2)

Assigns nullptr to nh.ptr_ and assignsnullopt to nh.alloc_[.](#1.sentence-3)

[ð](#itemdecl:2)

`constexpr node-handle& operator=(node-handle&& nh);
`

[2](#2)

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

*Preconditions*: Either !alloc_, orator_traits​::​propagate_on_container_move_assignment​::​value is true, or alloc_ == nh.alloc_[.](#2.sentence-1)

[3](#3)

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

*Effects*: 

- [(3.1)](#3.1)

  If ptr_ != nullptr, destroys the value_type subobject in the container_node_type object pointed to by ptr_ by calling ator_traits​::​destroy, then deallocates ptr_ by
calling ator_traits​::​template rebind_traits<container_node_type>​::​deallocate[.](#3.1.sentence-1)

- [(3.2)](#3.2)

  Assigns nh.ptr_ to ptr_[.](#3.2.sentence-1)

- [(3.3)](#3.3)

  If !alloc_ or ator_traits​::​propagate_on_container_move_assignment​::​value is true, move assigns nh.alloc_ to alloc_[.](#3.3.sentence-1)

- [(3.4)](#3.4)

  Assignsnullptr to nh.ptr_ and assigns nullopt tonh.alloc_[.](#3.4.sentence-1)

[4](#4)

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

*Returns*: *this[.](#4.sentence-1)

[5](#5)

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

*Throws*: Nothing[.](#5.sentence-1)
