[expected.syn]

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

## 22.8 Expected objects [[expected]](expected#syn)

### 22.8.2 Header <expected> synopsis [expected.syn]

[ð](#header:%3cexpected%3e)

// mostly freestandingnamespace std {// [[expected.unexpected]](expected.unexpected "22.8.3 Class template unexpected"), class template unexpectedtemplate<class E> class unexpected; // [[expected.bad]](expected.bad "22.8.4 Class template bad_­expected_­access"), class template bad_expected_accesstemplate<class E> class bad_expected_access; // [[expected.bad.void]](expected.bad.void "22.8.5 Class template specialization bad_­expected_­access<void>"), specialization for voidtemplate<> class bad_expected_access<void>; // in-place construction of unexpected valuesstruct unexpect_t {explicit unexpect_t() = default; }; inline constexpr unexpect_t unexpect{}; // [[expected.expected]](expected.expected "22.8.6 Class template expected"), class template expectedtemplate<class T, class E> class expected; // partially freestanding// [[expected.void]](expected.void "22.8.7 Partial specialization of expected for void types"), partial specialization of expected for void typestemplate<class T, class E> requires is_void_v<T> class expected<T, E>; // partially freestanding}
