[expected.un.cons]

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

## 22.8 Expected objects [[expected]](expected#un.cons)

### 22.8.3 Class template unexpected [[expected.unexpected]](expected.unexpected#expected.un.cons)

#### 22.8.3.2 Constructors [expected.un.cons]

[ð](#lib:unexpected,constructor)

`template<class Err = E>
  constexpr explicit unexpected(Err&& e);
`

[1](#1)

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

*Constraints*: 

- [(1.1)](#1.1)

is_same_v<remove_cvref_t<Err>, unexpected> is false; and

- [(1.2)](#1.2)

is_same_v<remove_cvref_t<Err>, in_place_t> is false; and

- [(1.3)](#1.3)

is_constructible_v<E, Err> is true[.](#1.sentence-1)

[2](#2)

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

*Effects*: Direct-non-list-initializes *unex* with std​::​forward<Err>(e)[.](#2.sentence-1)

[3](#3)

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

*Throws*: Any exception thrown by the initialization of *unex*[.](#3.sentence-1)

[ð](#lib:unexpected,constructor_)

`template<class... Args>
  constexpr explicit unexpected(in_place_t, Args&&... args);
`

[4](#4)

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

*Constraints*: is_constructible_v<E, Args...> is true[.](#4.sentence-1)

[5](#5)

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

*Effects*: Direct-non-list-initializes*unex* with std​::​forward<Args>(args)...[.](#5.sentence-1)

[6](#6)

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

*Throws*: Any exception thrown by the initialization of *unex*[.](#6.sentence-1)

[ð](#lib:unexpected,constructor__)

`template<class U, class... Args>
  constexpr explicit unexpected(in_place_t, initializer_list<U> il, Args&&... args);
`

[7](#7)

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

*Constraints*: is_constructible_v<E, initializer_list<U>&, Args...> is true[.](#7.sentence-1)

[8](#8)

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

*Effects*: Direct-non-list-initializes*unex* with il, std​::​forward<Args>(args)...[.](#8.sentence-1)

[9](#9)

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

*Throws*: Any exception thrown by the initialization of *unex*[.](#9.sentence-1)
