Bitcoin Core 28.99.0
P2P Digital Currency
|
#include <result.h>
Public Member Functions | |
Result () | |
Result (T obj) | |
Result (Error error) | |
Result (Result &&)=default | |
~Result ()=default | |
bool | has_value () const noexcept |
std::optional methods, so functions returning optional<T> can change to return Result<T> with minimal changes to existing code, and vice versa. More... | |
const T & | value () const LIFETIMEBOUND |
T & | value () LIFETIMEBOUND |
template<class U > | |
T | value_or (U &&default_value) const & |
template<class U > | |
T | value_or (U &&default_value) && |
operator bool () const noexcept | |
const T * | operator-> () const LIFETIMEBOUND |
const T & | operator* () const LIFETIMEBOUND |
T * | operator-> () LIFETIMEBOUND |
T & | operator* () LIFETIMEBOUND |
Private Types | |
using | T = std::conditional_t< std::is_same_v< M, void >, std::monostate, M > |
Private Member Functions | |
Result (const Result &)=delete | |
Disallow copy constructor, require Result to be moved for efficiency. More... | |
Result & | operator= (const Result &)=delete |
Disallow operator= to avoid confusion in the future when the Result class gains support for richer error reporting, and callers should have ability to set a new result value without clearing existing error messages. More... | |
Result & | operator= (Result &&)=delete |
Private Attributes | |
std::variant< bilingual_str, T > | m_variant |
Friends | |
template<typename FT > | |
bilingual_str | ErrorString (const Result< FT > &result) |
|
private |
|
privatedelete |
Disallow copy constructor, require Result to be moved for efficiency.
|
inline |
|
inline |
|
inline |
|
default |
|
default |
|
inlinenoexcept |
|
inlineexplicitnoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
privatedelete |
Disallow operator= to avoid confusion in the future when the Result class gains support for richer error reporting, and callers should have ability to set a new result value without clearing existing error messages.
|
privatedelete |
|
inline |
|
inline |
|
inline |
|
friend |
|
private |