[optional.ref.assign]

# 22 General utilities library [[utilities]](./#utilities)

## 22.5 Optional objects [[optional]](optional#ref.assign)

### 22.5.4 Partial specialization of optional for reference types [[optional.optional.ref]](optional.optional.ref#optional.ref.assign)

#### 22.5.4.3 Assignment [optional.ref.assign]

[ð](#itemdecl:1)

`constexpr optional& operator=(nullopt_t) noexcept;
`

[1](#1)

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

*Effects*: Assigns nullptr to *val*[.](#1.sentence-1)

[2](#2)

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

*Postconditions*: *this does not contain a value[.](#2.sentence-1)

[3](#3)

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

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

[ð](#itemdecl:2)

`template<class U>
  constexpr T& emplace(U&& u) noexcept(is_nothrow_constructible_v<T&, U>);
`

[4](#4)

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

*Constraints*: 

- [(4.1)](#4.1)

is_constructible_v<T&, U> is true, and

- [(4.2)](#4.2)

reference_constructs_from_temporary_v<T&, U> is false[.](#4.sentence-1)

[5](#5)

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

*Effects*: Equivalent to: *convert-ref-init-val*(std​::​forward<U>(u))[.](#5.sentence-1)
