50 template <
class Err = E>
73template <
class T,
class E = dberr_t>
83 : std::variant<T, E>(std::move(other)) {}
85 template <
class U, std::enable_if_t<
86 !std::is_same_v<std::decay_t<U>,
Expected>,
int> = 0>
88 : std::variant<T, E>(std::in_place_index<0>, std::forward<U>(u)) {}
99 return &std::get<0>(*
this);
104 return &std::get<0>(*
this);
109 return std::get<0>(*
this);
114 return std::get<0>(*
this);
119 return std::move(std::get<0>(*
this));
124 return std::move(std::get<0>(*
this));
133 return std::get<0>(*
this);
138 return std::get<0>(*
this);
143 return std::move(std::get<0>(*
this));
148 return std::move(std::get<0>(*
this));
153 return std::get<1>(*
this);
158 return std::get<1>(*
this);
163 return std::move(std::get<1>(*
this));
168 return std::move(std::get<1>(*
this));
C++23 std::expected.
Definition: ut0expected.h:74
constexpr Expected & operator=(Expected &&)=default
constexpr const T * operator->() const noexcept
Definition: ut0expected.h:97
constexpr T & value() &
Definition: ut0expected.h:136
constexpr Expected(U &&u) noexcept
Definition: ut0expected.h:87
constexpr const E & error() const &noexcept
Definition: ut0expected.h:151
E error_type
Definition: ut0expected.h:77
constexpr const E && error() const &&noexcept
Definition: ut0expected.h:161
T value_type
Definition: ut0expected.h:76
constexpr T & operator*() &noexcept
Definition: ut0expected.h:112
constexpr T && operator*() &&noexcept
Definition: ut0expected.h:122
constexpr const T && operator*() const &&noexcept
Definition: ut0expected.h:117
constexpr Expected(const Expected &other)=default
constexpr T * operator->() noexcept
Definition: ut0expected.h:102
constexpr Expected(Expected &&other) noexcept
Definition: ut0expected.h:82
constexpr Expected(Unexpected< U > &&u)
Definition: ut0expected.h:91
constexpr E && error() &&noexcept
Definition: ut0expected.h:166
constexpr const T & operator*() const &noexcept
Definition: ut0expected.h:107
constexpr E & error() &noexcept
Definition: ut0expected.h:156
constexpr T && value() &&
Definition: ut0expected.h:146
constexpr Expected & operator=(const Expected &)=default
constexpr const T && value() const &&
Definition: ut0expected.h:141
constexpr const T & value() const &
Definition: ut0expected.h:131
constexpr bool has_value() const noexcept
Definition: ut0expected.h:129
C++23 std::unexpected.
Definition: ut0expected.h:48
constexpr Unexpected(Err &&e)
Definition: ut0expected.h:51
constexpr E && error() &&noexcept
Definition: ut0expected.h:59
constexpr E & error() &noexcept
Definition: ut0expected.h:55
E m_error
Definition: ut0expected.h:62
constexpr const E && error() const &&noexcept
Definition: ut0expected.h:57
constexpr const E & error() const &noexcept
Definition: ut0expected.h:53
#define U
Definition: ctype-tis620.cc:73
Global error codes for the database.
#define T
Definition: jit_executor_value.cc:373
bool index(const std::string &value, const String &search_for, uint32_t *idx)
Definition: contains.h:76
noexcept
The return type for any call_and_catch(f, args...) call where f(args...) returns Type.
Definition: call_and_catch.h:76
Define std::hash<Gtid>.
Definition: gtid.h:355
This file contains a set of libraries providing overloads for regular dynamic allocation routines whi...
Definition: aligned_alloc.h:48
Unexpected(E) -> Unexpected< E >
Debug utilities for Innobase.
#define ut_a(EXPR)
Abort execution if EXPR does not evaluate to nonzero.
Definition: ut0dbg.h:97