37template <
typename T,
typename E>
class expected
53 constexpr explicit operator bool() const noexcept
66 return val == other.val;
68 return unex.unex == other.unex.unex;
73 return !(*
this == other);
90 constexpr T
value() const noexcept
95 constexpr E
error() const noexcept
107 constexpr T
value_or(
const T default_val)
const noexcept
125 constexpr E
error_or(
const E default_err)
const noexcept
constexpr bool operator==(const expected< T, E > &other) const noexcept
constexpr E error_or(const E default_err) const noexcept
Returns the unexpected value of the expected object or a default value.
constexpr expected(const unexpected< E > unex_val)
constexpr E error() const noexcept
constexpr T value_or(const T default_val) const noexcept
Returns the value of the expected object or a default value.
constexpr expected(const T val_in)
constexpr bool has_value() const noexcept
constexpr bool operator!=(const expected< T, E > &other) const noexcept
constexpr T value() const noexcept
const unexpected< E > unex
constexpr auto operator=(const expected< T, E > &other) noexcept -> expected< T, E > &
constexpr unexpected(const E unex_in)