25#ifndef MYSQL_HARNESS_STDX_EXPECTED_H_
26#define MYSQL_HARNESS_STDX_EXPECTED_H_
37#include <initializer_list>
45#if defined(__GNUC__) || defined(__clang__)
46#define RESO_ASSUME(x) \
47 if (!(x)) __builtin_unreachable();
48#elif defined(_MSC_VER)
49#define RESO_ASSUME(x) \
50 if (!(x)) __assume(0);
52#define RESO_ASSUME(x) \
89 static_assert(!std::is_same<E, void>::value,
"E must not be void");
107 std::enable_if_t<
std::is_constructible_v<E, Args &&...>> * =
nullptr>
109 error_(std::forward<Args>(args)...);
132template <
class T,
class E>
136template <
class T,
class E>
144 template <bool B = std::is_default_constructible<T>::value,
145 std::enable_if_t<B> * =
nullptr>
150 template <bool B = std::is_copy_constructible<T>::value,
151 std::enable_if_t<B> * =
nullptr>
156 template <bool B = std::is_move_constructible<T>::value,
157 std::enable_if_t<B> * =
nullptr>
163 template <
class... Args,
164 std::enable_if_t<std::is_constructible_v<T, Args &&...>,
void *> =
170 template <
class U,
class... Args,
171 std::enable_if_t<std::is_constructible_v<
172 T, std::initializer_list<U> &, Args &&...>,
189 std::enable_if_t<std::is_constructible_v<E, Args &&...>> * =
nullptr>
224 static_assert(!std::is_void<E>::value,
"E must not be void");
237 std::enable_if_t<std::is_constructible_v<E, Args &&...>> * =
nullptr>
239 new (&error_)
error_type(std::forward<Args>(args)...);
264 static_cast<int_type
>(y));
268template <
bool = true>
397template <class T, class E>
400 std::is_copy_constructible<E>>::value
404 std::is_move_constructible<E>>::value
413template <class T, class E>
417 and_<
std::is_copy_constructible<T>,
std::is_copy_assignable<T>>>,
418 and_<
std::is_copy_constructible<E>,
std::is_copy_assignable<E>>>::value
422 and_<
std::is_move_constructible<T>,
std::is_move_assignable<T>>>::value
431 : has_value_{has_value} {}
434 constexpr explicit operator bool() const noexcept {
return has_value(); }
439 swap(has_value_, other.has_value_);
446template <
class T,
class E>
453 template <bool B = std::is_default_constructible<T>::value,
454 std::enable_if_t<B> * =
nullptr>
456 storage_.construct_value();
459 template <
class UF,
class GF>
461 std::bool_constant<!std::is_convertible_v<UF, T> ||
462 !std::is_convertible_v<GF, E>>;
465 template <
class U,
class G,
class UF,
class GF>
467 std::is_constructible_v<T, UF> && std::is_constructible_v<E, GF> &&
468 !std::is_constructible_v<T, ExpectedImpl<U, G> &> &&
469 !std::is_constructible_v<T, ExpectedImpl<U, G>> &&
470 !std::is_constructible_v<T, const ExpectedImpl<U, G> &> &&
471 !std::is_constructible_v<T, const ExpectedImpl<U, G>> &&
472 !std::is_convertible_v<ExpectedImpl<U, G> &, T> &&
473 !std::is_convertible_v<ExpectedImpl<U, G>, T> &&
474 !std::is_convertible_v<const ExpectedImpl<U, G> &, T> &&
475 !std::is_convertible_v<const ExpectedImpl<U, G>, T> &&
482 class U,
class G,
class UF =
const U &,
class GF =
const G &,
483 std::enable_if_t<can_value_convert_construct<U, G, UF, GF>::value &&
488 storage_.construct_value(std::forward<UF>(*rhs));
490 storage_.construct_error(rhs.
error());
495 class U,
class G,
class UF =
const U &,
class GF =
const G &,
496 std::enable_if_t<can_value_convert_construct<U, G, UF, GF>::value &&
497 constructor_is_explicit<UF, GF>::value> * =
nullptr>
501 storage_.construct_value(std::forward<UF>(*rhs));
503 storage_.construct_error(rhs.
error());
508 class U,
class G,
class UF =
U,
class GF = G,
509 std::enable_if_t<can_value_convert_construct<U, G, UF, GF>::value &&
510 !constructor_is_explicit<UF, GF>::value> * =
nullptr>
513 if (rhs.has_value()) {
514 storage_.construct_value(std::forward<UF>(*rhs));
516 storage_.construct_error(rhs.error());
521 class U,
class G,
class UF =
U,
class GF = G,
522 std::enable_if_t<can_value_convert_construct<U, G, UF, GF>::value &&
523 constructor_is_explicit<UF, GF>::value> * =
nullptr>
526 if (rhs.has_value()) {
527 storage_.construct_value(std::forward<UF>(*rhs));
529 storage_.construct_error(rhs.error());
535 std::negation<std::is_same<std::in_place_t, stdx::remove_cvref_t<U>>>,
538 std::is_constructible<T, U>>;
542 std::negation<std::is_convertible<U, T>>;
544 template <
class U = T,
545 std::enable_if_t<can_construct_from_value_type<U>::value &&
549 storage_.construct_value(std::forward<U>(v));
552 template <
class U = T,
553 std::enable_if_t<can_construct_from_value_type<U>::value &&
554 can_construct_from_value_type_explicit<U>::value>
557 storage_.construct_value(std::in_place, std::forward<U>(v));
563 std::enable_if_t<std::is_constructible_v<T, Args &&...>> * =
nullptr>
566 storage_.construct_value(std::in_place, std::forward<Args>(args)...);
572 std::enable_if_t<std::is_constructible_v<E, Args &&...>> * =
nullptr>
575 storage_.construct_error(std::in_place, std::forward<Args>(args)...);
581 storage_.construct_value(other.
storage_.value());
583 storage_.construct_error(other.
storage_.error());
588 std::is_nothrow_move_constructible<E>::value
589 &&std::is_nothrow_move_constructible<T>::value)
592 storage_.construct_value(std::move(other.storage_.value()));
594 storage_.construct_error(std::move(other.storage_.error()));
599 std::enable_if_t<std::is_constructible_v<E, const G &>> * =
nullptr>
601 storage_.construct_error(e.
value());
605 std::enable_if_t<std::is_constructible_v<E, G>> * =
nullptr>
607 storage_.construct_error(std::move(e.value()));
622 template <
class U = T,
625 !std::conjunction_v<std::is_scalar<T>,
626 std::is_same<T, std::decay_t<U>>> &&
627 std::is_constructible_v<T, U> && std::is_assignable_v<T &, U>>
631 storage_.
value() = std::forward<U>(v);
642 storage_.destruct_value();
644 storage_.destruct_error();
649 template <
class U = T,
class G = E>
651#if defined(__cpp_lib_is_swappable)
652 std::is_swappable<U>::value && std::is_swappable<G>::value &&
654 (std::is_move_constructible<U>::value ||
655 std::is_move_constructible<G>::value)>
657 std::is_nothrow_move_constructible<T>::value
658 &&std::is_nothrow_move_constructible<E>::value
659#if defined(__cpp_lib_is_swappable)
660 &&std::is_nothrow_swappable<T &>::value
661 &&std::is_nothrow_swappable<E &>::value
666 if (
bool(*
this) && bool(other)) {
668 }
else if (!
bool(*
this) && !
bool(other)) {
670 }
else if (
bool(*
this) && !
bool(other)) {
674 other.
storage_.construct_value(std::move(storage_.value()));
675 storage_.destruct_value();
676 storage_.construct_error(std::move(t));
680 }
else if (!
bool(*
this) &&
bool(other)) {
689 return std::move(storage_.value());
698 return storage_.value();
703 return storage_.value();
709 return storage_.value_ptr();
714 return storage_.value_ptr();
719 static_assert(std::is_copy_constructible<T>::value &&
720 std::is_convertible<U &&, T>::value,
721 "T must be copy-constructible and convertible from U&&");
723 return has_value() ? **this :
static_cast<T
>(std::forward<U>(v));
728 static_assert(std::is_move_constructible<T>::value &&
729 std::is_convertible<U &&, T>::value,
730 "T must be move-constructible and convertible from U&&");
732 return has_value() ? std::move(**
this) :
static_cast<T
>(std::forward<U>(v));
738 return storage_.error();
742 return std::move(storage_.error());
746 return storage_.error();
750 return std::move(storage_.error());
774 std::enable_if_t<std::is_constructible_v<E, Args &&...>> * =
nullptr>
777 storage_.construct_error(std::in_place, std::forward<Args>(args)...);
783 storage_.construct_error(other.
storage_.error());
788 std::is_nothrow_move_constructible<E>::value)
791 storage_.construct_error(std::move(other.storage_.error()));
808 storage_.construct_error(e.
value());
812 storage_.construct_error(std::move(e.value()));
818 storage_.destruct_error();
823 template <
class G = E, std::enable_if_t<
824#if defined(__cpp_lib_is_swappable)
825 std::is_swappable<G>::value &&
827 std::is_move_constructible<G>::value,
830 std::is_nothrow_move_constructible<G>::value
831#if defined(__cpp_lib_is_swappable)
832 &&std::is_nothrow_swappable<G &>::value
837 if (
bool(*
this) && bool(other)) {
839 }
else if (!
bool(*
this) && !bool(other)) {
840 swap(storage_.error(), other.storage_.error());
841 }
else if (
bool(*
this) && !
bool(other)) {
844 storage_.construct_error(std::move(other.error()));
848 }
else if (!
bool(*
this) &&
bool(other)) {
856 return storage_.error();
860 return std::move(storage_.error());
864 return storage_.error();
868 return std::move(storage_.error());
882template <
class T,
class E>
891 class Exp,
class Func,
893 std::enable_if_t<std::is_void_v<value_type>
894 ? std::is_invocable_v<Func>
895 : std::is_invocable_v<Func, value_type>> * =
nullptr>
897 if constexpr (std::is_void_v<value_type>) {
898 using Ret = std::invoke_result_t<Func>;
901 "Func must return a stdx::expected<>");
903 if (exp.has_value()) {
904 return std::invoke(func);
909 using Ret = std::invoke_result_t<Func, value_type>;
912 "Func must return a stdx::expected<>");
914 if (exp.has_value()) {
915 return std::invoke(func, *std::forward<Exp>(exp));
922template <
class Exp,
class Func,
924 std::enable_if_t<std::is_invocable_v<Func, error_type>> * =
nullptr>
929 "Func must return an expected<>");
931 if (exp.has_value()) {
932 return std::forward<Exp>(exp);
935 return std::invoke(std::forward<Func>(func), std::forward<Exp>(exp).
error());
940template <
class T,
class E>
945 static_assert(!std::is_void<E>::value,
"E must not be void");
946 static_assert(!std::is_reference<T>::value,
"T must not be a reference");
947 static_assert(!std::is_same<T, std::remove_cv<std::in_place_t>>::value,
948 "T must not be std::in_place_t");
949 static_assert(!std::is_same<T, std::remove_cv<unexpected<E>>>::value,
950 "T must not be unexpected<E>");
951 static_assert(!std::is_reference<E>::value,
"E must not be a reference");
960 template <
class Func>
965 template <
class Func>
970 template <
class Func>
975 template <
class Func>
984 template <
class Func>
989 template <
class Func>
994 template <
class Func>
999 template <
class Func>
1008 template <
class Func>
1013 template <
class Func>
1018 template <
class Func>
1023 template <
class Func>
1029template <
class Exp,
class Func>
1034 if constexpr (std::is_void_v<func_value_type>) {
1035 using func_return_type = std::invoke_result_t<Func>;
1039 if (!exp.has_value()) {
1040 return result_type{
stdx::unexpect, std::forward<Exp>(exp).error()};
1043 if constexpr (std::is_void_v<func_return_type>) {
1045 return result_type();
1047 return result_type(std::invoke(func));
1050 using func_return_type = std::invoke_result_t<Func, func_value_type>;
1054 if (!exp.has_value()) {
1055 return result_type{
stdx::unexpect, std::forward<Exp>(exp).error()};
1058 if constexpr (std::is_void_v<func_return_type>) {
1059 std::invoke(func, *std::forward<Exp>(exp));
1060 return result_type();
1062 return result_type(std::invoke(func, *std::forward<Exp>(exp)));
1067template <
class E1,
class E2>
1072template <
class E1,
class E2>
1077template <
class T1,
class E1,
class T2,
class E2>
1085template <
class E1,
class E2>
1094template <
class T1,
class E1,
class T2,
class E2>
1099template <
class T1,
class E1,
class E2>
1106template <
class T1,
class E1,
class E2>
1111template <
class T1,
class E1,
class E2>
1116template <
class T1,
class E1,
class E2>
Definition: expected.h:428
constexpr bool has_value() const
Definition: expected.h:433
bool has_value_
Definition: expected.h:443
void swap(ExpectedImplBase &other) noexcept
Definition: expected.h:436
constexpr ExpectedImplBase(bool has_value) noexcept
Definition: expected.h:430
base::storage_t< void, E > storage_
Definition: expected.h:876
constexpr ExpectedImpl(const ExpectedImpl &other)
Definition: expected.h:780
ExpectedImpl & operator=(ExpectedImpl const &other)
Definition: expected.h:795
constexpr ExpectedImpl() noexcept
Definition: expected.h:769
constexpr error_type && error() &&
Definition: expected.h:866
constexpr ExpectedImpl(unexpected< E > &&e)
Definition: expected.h:811
ExpectedImpl & operator=(ExpectedImpl &&other)
Definition: expected.h:801
void value_type
Definition: expected.h:765
constexpr ExpectedImpl(stdx::unexpect_t, Args &&... args)
Definition: expected.h:775
constexpr error_type & error() &
Definition: expected.h:862
constexpr unexpected_type get_unexpected() const
Definition: expected.h:871
constexpr ExpectedImpl(ExpectedImpl &&other) noexcept(std::is_nothrow_move_constructible< E >::value)
Definition: expected.h:787
constexpr const error_type && error() const &&
Definition: expected.h:858
constexpr const error_type & error() const &
Definition: expected.h:854
void swap(ExpectedImpl &other) noexcept(std::is_nothrow_move_constructible< G >::value)
Definition: expected.h:829
E error_type
Definition: expected.h:766
~ExpectedImpl()
Definition: expected.h:816
constexpr ExpectedImpl(const unexpected< E > &e)
Definition: expected.h:807
Definition: expected.h:447
std::enable_if_t<(std::is_move_constructible< U >::value||std::is_move_constructible< G >::value)> swap(ExpectedImpl &other) noexcept(std::is_nothrow_move_constructible< T >::value &&std::is_nothrow_move_constructible< E >::value)
Definition: expected.h:656
value_type & operator*() &
Definition: expected.h:695
constexpr ExpectedImpl(const unexpected< G > &e)
Definition: expected.h:600
value_type & value() &
Definition: expected.h:691
ExpectedImpl & operator=(ExpectedImpl &&other)
Definition: expected.h:616
std::bool_constant<!std::is_convertible_v< UF, T >||!std::is_convertible_v< GF, E > > constructor_is_explicit
Definition: expected.h:462
constexpr ExpectedImpl(std::in_place_t, Args &&... args)
Definition: expected.h:564
constexpr ExpectedImpl(const ExpectedImpl< U, G > &rhs)
Definition: expected.h:485
E error_type
Definition: expected.h:450
constexpr const value_type && value() const &&
Definition: expected.h:688
value_type * operator->()
Definition: expected.h:706
constexpr error_type & error() &
Definition: expected.h:744
constexpr ExpectedImpl(U &&v)
Definition: expected.h:548
ExpectedImpl & operator=(U &&v)
Definition: expected.h:629
std::conjunction< std::negation< std::is_same< std::in_place_t, stdx::remove_cvref_t< U > > >, std::negation< std::is_same< ExpectedImpl< T, E >, stdx::remove_cvref_t< U > > >, std::negation< std::is_same< unexpected< E >, stdx::remove_cvref_t< U > > >, std::is_constructible< T, U > > can_construct_from_value_type
Definition: expected.h:538
std::bool_constant< std::is_constructible_v< T, UF > &&std::is_constructible_v< E, GF > &&!std::is_constructible_v< T, ExpectedImpl< U, G > & > &&!std::is_constructible_v< T, ExpectedImpl< U, G > > &&!std::is_constructible_v< T, const ExpectedImpl< U, G > & > &&!std::is_constructible_v< T, const ExpectedImpl< U, G > > &&!std::is_convertible_v< ExpectedImpl< U, G > &, T > &&!std::is_convertible_v< ExpectedImpl< U, G >, T > &&!std::is_convertible_v< const ExpectedImpl< U, G > &, T > &&!std::is_convertible_v< const ExpectedImpl< U, G >, T > &&!std::is_constructible_v< unexpected< E >, ExpectedImpl< U, G > & > &&!std::is_constructible_v< unexpected< E >, ExpectedImpl< U, G > > &&!std::is_constructible_v< unexpected< E >, const ExpectedImpl< U, G > & > &&!std::is_constructible_v< unexpected< E >, const ExpectedImpl< U, G > > > can_value_convert_construct
Definition: expected.h:479
constexpr ExpectedImpl(ExpectedImpl &&other) noexcept(std::is_nothrow_move_constructible< E >::value &&std::is_nothrow_move_constructible< T >::value)
Definition: expected.h:587
constexpr value_type value_or(U &&v) &&
Definition: expected.h:727
constexpr ExpectedImpl(stdx::unexpect_t, Args &&... args)
Definition: expected.h:573
constexpr const error_type && error() const &&
Definition: expected.h:740
constexpr const value_type & value() const &
Definition: expected.h:687
constexpr value_type value_or(U &&v) const &
Definition: expected.h:718
constexpr const value_type & operator*() const &
Definition: expected.h:700
constexpr ExpectedImpl(ExpectedImpl< U, G > &&rhs)
Definition: expected.h:511
constexpr error_type && error() &&
Definition: expected.h:748
~ExpectedImpl()
Definition: expected.h:640
T value_type
Definition: expected.h:449
constexpr unexpected_type get_unexpected() const
Definition: expected.h:753
constexpr ExpectedImpl(const ExpectedImpl &other)
Definition: expected.h:578
constexpr const value_type * operator->() const
Definition: expected.h:711
ExpectedImpl & operator=(ExpectedImpl const &other)
Definition: expected.h:610
constexpr const error_type & error() const &
Definition: expected.h:736
constexpr ExpectedImpl()
Definition: expected.h:455
constexpr ExpectedImpl(unexpected< G > &&e)
Definition: expected.h:606
value_type && value() &&
Definition: expected.h:692
base::storage_t< T, E > storage_
Definition: expected.h:758
std::negation< std::is_convertible< U, T > > can_construct_from_value_type_explicit
Definition: expected.h:542
Definition: expected.h:943
constexpr auto or_else(Func &&func) &
Definition: expected.h:985
constexpr auto or_else(Func &&func) &&
Definition: expected.h:990
constexpr auto and_then(Func &&func) &&
Definition: expected.h:966
constexpr auto and_then(Func &&func) const &
Definition: expected.h:971
constexpr auto transform(Func &&func) &
Definition: expected.h:1009
constexpr auto transform(Func &&func) const &
Definition: expected.h:1019
constexpr auto transform(Func &&func) const &&
Definition: expected.h:1024
constexpr auto or_else(Func &&func) const &&
Definition: expected.h:1000
constexpr auto transform(Func &&func) &&
Definition: expected.h:1014
constexpr auto or_else(Func &&func) const &
Definition: expected.h:995
constexpr auto and_then(Func &&func) const &&
Definition: expected.h:976
constexpr auto and_then(Func &&func) &
Definition: expected.h:961
Definition: expected.h:87
constexpr error_type & value() &noexcept
Definition: expected.h:112
constexpr error_type && value() &&noexcept
Definition: expected.h:114
error_type error_
Definition: expected.h:120
constexpr unexpected(error_type &&e)
Definition: expected.h:95
constexpr const error_type & value() const &noexcept
Definition: expected.h:113
E error_type
Definition: expected.h:91
constexpr const error_type && value() const &&noexcept
Definition: expected.h:115
#define U
Definition: ctype-tis620.cc:74
error_type
Definition: error.h:35
#define RESO_ASSUME(x)
Definition: expected.h:52
Header for compiler-dependent features.
#define MY_COMPILER_GCC_DIAGNOSTIC_IGNORE(X)
Definition: my_compiler.h:260
#define MY_COMPILER_DIAGNOSTIC_PUSH()
save the compiler's diagnostic (enabled warnings, errors, ...) state
Definition: my_compiler.h:295
#define MY_COMPILER_DIAGNOSTIC_POP()
restore the compiler's diagnostic (enabled warnings, errors, ...) state
Definition: my_compiler.h:296
uint16_t value_type
Definition: vt100.h:183
Definition: varlen_sort.h:183
constexpr member_policy operator|(member_policy x, member_policy y)
Definition: expected.h:260
std::disjunction< B... > or_
Definition: expected.h:393
constexpr auto or_else_impl(Exp &&exp, Func &&func)
Definition: expected.h:925
constexpr auto and_then_impl(Exp &&exp, Func &&func)
Definition: expected.h:896
member_policy
Definition: expected.h:254
std::negation< B > not_
Definition: expected.h:387
std::conjunction< B... > and_
Definition: expected.h:390
bool operator!=(const unexpected< E1 > &a, const unexpected< E2 > &b)
Definition: expected.h:1073
constexpr auto expected_transform_impl(Exp &&exp, Func &&func)
Definition: expected.h:1030
constexpr unexpect_t unexpect
Definition: expected.h:84
constexpr auto make_unexpected(E &&e) -> unexpected< std::decay_t< E > >
Definition: expected.h:124
unexpected(E) -> unexpected< E >
typename remove_cvref< T >::type remove_cvref_t
Definition: type_traits.h:72
bool operator==(const unexpected< E1 > &a, const unexpected< E2 > &b)
Definition: expected.h:1068
std::conditional_t< !std::is_array< T >::value, std::unique_ptr< T, detail::Deleter< T > >, std::conditional_t< detail::is_unbounded_array_v< T >, std::unique_ptr< T, detail::Array_deleter< std::remove_extent_t< T > > >, void > > unique_ptr
The following is a common type that is returned by all the ut::make_unique (non-aligned) specializati...
Definition: ut0new.h:2436
required string type
Definition: replication_group_member_actions.proto:33
static void swap(String &a, String &b) noexcept
Definition: sql_string.h:611
constexpr assign_base() noexcept=default
constexpr assign_base() noexcept=default
constexpr assign_base() noexcept=default
constexpr assign_base() noexcept=default
Definition: expected.h:340
constexpr ctor_base() noexcept=default
constexpr ctor_base() noexcept=default
constexpr ctor_base() noexcept=default
constexpr ctor_base() noexcept=default
Definition: expected.h:292
constexpr default_ctor_base() noexcept=delete
Definition: expected.h:269
constexpr default_ctor_base() noexcept=default
Definition: expected.h:880
Definition: expected.h:80
specialized storage for <void, E>.
Definition: expected.h:220
error_type & error() &
Definition: expected.h:245
void construct_error(std::in_place_t, Args &&... args)
Definition: expected.h:238
constexpr const error_type && error() const &&
Definition: expected.h:246
void destruct_error()
Definition: expected.h:242
const error_type & error() const &
Definition: expected.h:244
void value_type
Definition: expected.h:221
constexpr error_type && error() &&
Definition: expected.h:247
E error_type
Definition: expected.h:222
error_type error_
Definition: expected.h:250
storage_t()
Definition: expected.h:226
void construct_error(error_type &&e)
Definition: expected.h:230
void construct_error(error_type const &e)
Definition: expected.h:229
~storage_t()
Definition: expected.h:227
Definition: expected.h:137
void construct_value(value_type &&e)
Definition: expected.h:158
constexpr const error_type && error() const &&
Definition: expected.h:205
error_type error_
Definition: expected.h:211
void construct_error(error_type &&e)
Definition: expected.h:182
void destruct_value()
Definition: expected.h:179
value_type & value() &
Definition: expected.h:198
void construct_value(value_type const &e)
Definition: expected.h:152
~storage_t()
Definition: expected.h:142
value_type * value_ptr()
Definition: expected.h:202
E error_type
Definition: expected.h:139
constexpr const value_type && value() const &&
Definition: expected.h:197
constexpr error_type & error() &
Definition: expected.h:206
constexpr const value_type & value() const &
Definition: expected.h:196
constexpr value_type && value() &&
Definition: expected.h:199
void construct_value()
Definition: expected.h:146
void construct_value(std::in_place_t, Args &&... args)
Definition: expected.h:166
void destruct_error()
Definition: expected.h:194
void construct_error(std::in_place_t, Args &&... args)
Definition: expected.h:190
T value_type
Definition: expected.h:138
value_type value_
Definition: expected.h:210
storage_t()
Definition: expected.h:141
void construct_error(error_type const &e)
Definition: expected.h:181
void construct_value(std::in_place_t, std::initializer_list< U > il, Args &&... args)
Definition: expected.h:174
const value_type * value_ptr() const
Definition: expected.h:201
constexpr error_type && error() &&
Definition: expected.h:207
constexpr const error_type & error() const &
Definition: expected.h:204