5#ifndef BITCOIN_UTIL_RESULT_H
6#define BITCOIN_UTIL_RESULT_H
38 using T = std::conditional_t<std::is_same_v<M, void>, std::monostate,
M>;
52 template <
typename FT>
83 return has_value() ? std::move(
value()) : std::forward<U>(default_value);
85 explicit operator bool() const noexcept {
return has_value(); }
Result & operator=(const Result &)=delete
T & value() LIFETIMEBOUND
Result & operator=(Result &&)=delete
T & operator*() LIFETIMEBOUND
T value_or(U &&default_value) const &
bool has_value() const noexcept
const T & operator*() const LIFETIMEBOUND
const T & value() const LIFETIMEBOUND
const T * operator->() const LIFETIMEBOUND
Result(const Result &)=delete
Disallow copy constructor, require Result to be moved for efficiency.
T value_or(U &&default_value) &&
friend bilingual_str ErrorString(const Result< FT > &result)
std::conditional_t< std::is_same_v< M, void >, std::monostate, M > T
T * operator->() LIFETIMEBOUND
std::variant< bilingual_str, T > m_variant
Result(Result &&)=default
bilingual_str ErrorString(const Result< T > &result)