22 General utilities library [utilities]

22.8 Expected objects [expected]

22.8.3 Class template unexpected [expected.unexpected]

22.8.3.2 Constructors [expected.un.ctor]

template<class Err = E> constexpr explicit unexpected(Err&& e);
Constraints:
  • is_­same_­v<remove_­cvref_­t<Err>, unexpected> is false; and
  • is_­same_­v<remove_­cvref_­t<Err>, in_­place_­t> is false; and
  • is_­constructible_­v<E, Err> is true.
Effects: Direct-non-list-initializes val with std​::​forward<Err>(e).
Throws: Any exception thrown by the initialization of val.
template<class... Args> constexpr explicit unexpected(in_place_t, Args&&... args);
Constraints: is_­constructible_­v<E, Args...> is true.
Effects: Direct-non-list-initializes val with std​::​forward<Args>(args)....
Throws: Any exception thrown by the initialization of val.
template<class U, class... Args> constexpr explicit unexpected(in_place_t, initializer_list<U> il, Args&&... args);
Constraints: is_­constructible_­v<E, initializer_­list<U>&, Args...> is true.
Effects: Direct-non-list-initializes val with il, std​::​forward<Args>(args)....
Throws: Any exception thrown by the initialization of val.