
std::expected - cppreference.com
The class template std::expected provides a way to represent either of two values: an expected value of type T, or an unexpected value of type E. expected is never valueless.
std::expected<T,E>::expected - cppreference.com
6) Constructs an object that contains an expected value, initialized as if direct-initializing (but not direct-list-initializing) an object of type T with the expression std::forward<U>(v).
std::expected<T,E>::operator= - cppreference.com
In all cases, if T is not (possibly cv-qualified) void, the destruction of old value and construction of new value is performed as if by the following exposition-only function reinit_expected.
std::expected<T,E>::~expected - cppreference.com
If has_value () is true, destroys the expected value. Otherwise, destroys the unexpected value.
Standard library header <expected> (C++23) - cppreference.com
namespace std { // class template unexpected template<class E> class unexpected; // class template bad_expected_access template<class E> class bad_expected_access; // specialization of …
std::expected<T,E>:: operator= - cppreference.com
Effects Primary template assignment operators 1,2) Assigns the state of other to *this. If has_value () and rhs.has_value() have different values (i.e. one of *this and other contains an expected value val …
std::unexpected - cppreference.com
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 …
std::expected<T,E>::and_then - cppreference.com
If *this represents an expected value, invokes f and returns its result. Otherwise, returns a std::expected object that contains an unexpected value, which is initialized with the unexpected value of *this.
std::expected<T,E>::or_else - cppreference.com
1-4) The expected value is initialized with the expected value val of *this.
std::expected<T,E>::transform - cppreference.com
If *this contains an expected value, invokes f and returns a std::expected object that contains its result; otherwise, returns a std::expected object that contains a copy of error().