[saferecl.hp.holder.ctor]

# 32 Concurrency support library [[thread]](./#thread)

## 32.11 Safe reclamation [[saferecl]](saferecl#hp.holder.ctor)

### 32.11.3 Hazard pointers [[saferecl.hp]](saferecl.hp#holder.ctor)

#### 32.11.3.4 Class hazard_pointer [[saferecl.hp.holder]](saferecl.hp.holder#ctor)

#### 32.11.3.4.2 Constructors, destructor, and assignment [saferecl.hp.holder.ctor]

[ð](#lib:hazard_pointer,constructor)

`hazard_pointer() noexcept;
`

[1](#1)

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

*Postconditions*: *this is empty[.](#1.sentence-1)

[ð](#lib:hazard_pointer,constructor_)

`hazard_pointer(hazard_pointer&& other) noexcept;
`

[2](#2)

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

*Postconditions*: If other is empty, *this is empty[.](#2.sentence-1)

Otherwise,*this owns the hazard pointer originally owned by other;other is empty[.](#2.sentence-2)

[ð](#lib:hazard_pointer,destructor)

`~hazard_pointer();
`

[3](#3)

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

*Effects*: If *this is not empty,
destroys the hazard pointer owned by *this,
thereby ending its current protection epoch[.](#3.sentence-1)

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

`hazard_pointer& operator=(hazard_pointer&& other) noexcept;
`

[4](#4)

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

*Effects*: If this == &other is true, no effect[.](#4.sentence-1)

Otherwise, if *this is not empty,
destroys the hazard pointer owned by *this,
thereby ending its current protection epoch[.](#4.sentence-2)

[5](#5)

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

*Postconditions*: If other was empty, *this is empty[.](#5.sentence-1)

Otherwise, *this owns the hazard pointer originally
owned by other[.](#5.sentence-2)

If this != &other is true, other is empty[.](#5.sentence-3)

[6](#6)

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

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