std::unexpect_t, std::unexpect

From cppreference.com
< cpp‎ | utility‎ | expected
 
 
Utilities library
General utilities
Date and time
Function objects
Formatting library (C++20)
(C++11)
Relational operators (deprecated in C++20)
Integer comparison functions
(C++20)(C++20)(C++20)   
(C++20)
Swap and type operations
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
Common vocabulary types
(C++11)
(C++17)
(C++17)
(C++17)
(C++11)
(C++17)
(C++23)
Elementary string conversions
(C++17)
(C++17)
 
std::expected
Member functions
Observers
Monadic operations
Modifiers
Non-member functions
(C++23)
(C++23)
Helper classes
(C++23)
unexpect_tunexpect
(C++23)(C++23)
 
Defined in header <expected>
struct unexpect_t {

    explicit unexpect_t() = default;

};
(1) (since C++23)
inline constexpr unexpect_t unexpect{};
(2) (since C++23)
1) A tag type for in-place construction of an unexpected value in an std::expected object.
2) A constant of type const std::unexpect_t which is usually directly passed to a constructor of std::expected to construct an unexpected value.

Notes

Like other construction tag types, unexpect_t is a trivial, empty class with an explicit default constructor.

See also

constructs the expected object
(public member function)