![]() |
Bitcoin Core 30.99.0
P2P Digital Currency
|
The util::Expected class provides a standard way for low-level functions to return either error values or result values. More...
#include <expected.h>
Public Member Functions | |
| constexpr | Expected () |
| constexpr | Expected (ValueType v) |
| template<class Err > | |
| constexpr | Expected (Unexpected< Err > u) |
| constexpr bool | has_value () const noexcept |
| constexpr | operator bool () const noexcept |
| constexpr const ValueType & | value () const LIFETIMEBOUND |
| constexpr ValueType & | value () LIFETIMEBOUND |
| template<class U > | |
| ValueType | value_or (U &&default_value) const & |
| template<class U > | |
| ValueType | value_or (U &&default_value) && |
| constexpr const E & | error () const LIFETIMEBOUND |
| constexpr E & | error () LIFETIMEBOUND |
| constexpr ValueType & | operator* () LIFETIMEBOUND |
| constexpr const ValueType & | operator* () const LIFETIMEBOUND |
| constexpr ValueType * | operator-> () LIFETIMEBOUND |
| constexpr const ValueType * | operator-> () const LIFETIMEBOUND |
Private Types | |
| using | ValueType = std::conditional_t< std::is_same_v< T, void >, std::monostate, T > |
Private Attributes | |
| std::variant< ValueType, E > | m_data |
The util::Expected class provides a standard way for low-level functions to return either error values or result values.
It provides a smaller version of std::expected from C++23. Missing features can be added, if needed.
Definition at line 33 of file expected.h.
|
private |
Definition at line 36 of file expected.h.
|
inlineconstexpr |
Definition at line 40 of file expected.h.
|
inlineconstexpr |
Definition at line 41 of file expected.h.
|
inlineconstexpr |
Definition at line 43 of file expected.h.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexprnoexcept |
Definition at line 47 of file expected.h.
|
inlineexplicitconstexprnoexcept |
Definition at line 48 of file expected.h.
|
inlineconstexpr |
Definition at line 84 of file expected.h.
|
inlineconstexpr |
Definition at line 83 of file expected.h.
|
inlineconstexpr |
Definition at line 87 of file expected.h.
|
inlineconstexpr |
Definition at line 86 of file expected.h.
|
inlineconstexpr |
|
inlineconstexpr |
|
inline |
Definition at line 67 of file expected.h.
|
inline |
|
private |
Definition at line 37 of file expected.h.