std::unexpected
From cppreference.com
Defined in header <expected>
|
||
template< class E > class unexpected; |
(since C++23) | |
The class template std::unexpected
represents an unexpected value stored in std::expected. In particular, std::expected has constructors with std::unexpected
as a single argument, which creates an expected
object that contains an unexpected value.
A program is ill-formed if it instantiates an unexpected
with a non-object type, an array type, a specialization of std::unexpected
, or a cv-qualified type.
Contents |
[edit] Template parameters
E | - | the type of the unexpected value. The type must not be an array type, a non-object type, a specialization of std::unexpected , or a cv-qualified type.
|
[edit] Member functions
constructs the unexpected object (public member function) | |
(destructor) (implicitly declared) |
destroys the unexpected object, along with the stored value (public member function) |
operator= (implicitly declared) |
assigns the stored value (public member function) |
accesses the stored value (public member function) | |
swaps the stored value (public member function) |
[edit] Non-member functions
(C++23) |
compares the stored value (function template) |
(C++23) |
specializes the |