#include <userver/utils/expected.hpp>
For holding a value or an error.
Definition at line 85 of file expected.hpp.
Public Member Functions | |
| expected (const S &success) | |
| expected (S &&success) | |
| expected (const unexpected< E > &error) | |
| expected (unexpected< E > &&error) | |
| template<class G> requires std::is_convertible_v<G, E> | |
| expected (const unexpected< G > &error) | |
| template<class G> requires std::is_convertible_v<G, E> | |
| expected (unexpected< G > &&error) | |
| bool | has_value () const noexcept |
| Check whether *this contains an expected value. | |
| operator bool () const noexcept | |
| Check whether *this contains an expected value. | |
| S & | value () & |
| Return reference to the value or throws bad_expected_access if it's not available. | |
| S && | value () && |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| const S & | value () const & |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| S & | operator* () &noexcept |
| Unchecked access to the contained value. | |
| S && | operator* () &&noexcept |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| const S & | operator* () const &noexcept |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| S * | operator-> () noexcept |
| Unchecked access to the members of the contained value. | |
| const S * | operator-> () const noexcept |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| E & | error () |
| Return reference to the error value or throws bad_expected_access if it's not available. | |
| const E & | error () const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
|
constexpr |
Definition at line 208 of file expected.hpp.
| utils::expected< S, E >::expected | ( | const S & | success | ) |
Definition at line 213 of file expected.hpp.
| utils::expected< S, E >::expected | ( | S && | success | ) |
Definition at line 218 of file expected.hpp.
| utils::expected< S, E >::expected | ( | const unexpected< E > & | error | ) |
Definition at line 223 of file expected.hpp.
| utils::expected< S, E >::expected | ( | unexpected< E > && | error | ) |
Definition at line 228 of file expected.hpp.
| utils::expected< S, E >::expected | ( | const unexpected< G > & | error | ) |
Definition at line 235 of file expected.hpp.
| utils::expected< S, E >::expected | ( | unexpected< G > && | error | ) |
Definition at line 242 of file expected.hpp.
| E & utils::expected< S, E >::error | ( | ) |
Return reference to the error value or throws bad_expected_access if it's not available.
| utils::bad_expected_access | if success value is not available |
Definition at line 309 of file expected.hpp.
| const E & utils::expected< S, E >::error | ( | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 318 of file expected.hpp.
|
noexcept |
Check whether *this contains an expected value.
Definition at line 247 of file expected.hpp.
|
explicitnoexcept |
Check whether *this contains an expected value.
Definition at line 252 of file expected.hpp.
|
noexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 286 of file expected.hpp.
|
noexcept |
Unchecked access to the contained value.
Definition at line 280 of file expected.hpp.
|
noexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 291 of file expected.hpp.
|
noexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 303 of file expected.hpp.
|
noexcept |
Unchecked access to the members of the contained value.
Definition at line 297 of file expected.hpp.
| S & utils::expected< S, E >::value | ( | ) | & |
Return reference to the value or throws bad_expected_access if it's not available.
| utils::bad_expected_access | if *this contain an unexpected value |
Definition at line 257 of file expected.hpp.
| S && utils::expected< S, E >::value | ( | ) | && |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 266 of file expected.hpp.
| const S & utils::expected< S, E >::value | ( | ) | const & |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 271 of file expected.hpp.