Files
2025-10-25 03:02:53 +03:00

2.6 KiB
Raw Permalink Blame History

[expected.un.cons]

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.cons]

🔗

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

1

#

Constraints:

is_same_v<remove_cvref_t, unexpected> is false; and

is_same_v<remove_cvref_t, in_place_t> is false; and

is_constructible_v<E, Err> is true.

2

#

Effects: Direct-non-list-initializes unex with std::forward(e).

3

#

Throws: Any exception thrown by the initialization of unex.

🔗

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

4

#

Constraints: is_constructible_v<E, Args...> is true.

5

#

Effects: Direct-non-list-initializesunex with std::forward(args)....

6

#

Throws: Any exception thrown by the initialization of unex.

🔗

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

7

#

Constraints: is_constructible_v<E, initializer_list&, Args...> is true.

8

#

Effects: Direct-non-list-initializesunex with il, std::forward(args)....

9

#

Throws: Any exception thrown by the initialization of unex.