27#ifndef C10_UTIL_OPTIONAL_H_
28#define C10_UTIL_OPTIONAL_H_
30#include <c10/macros/Macros.h>
32#include <c10/util/in_place.h>
36#include <initializer_list>
42#include <c10/util/C++17.h>
43#include <c10/util/Metaprogramming.h>
45C10_CLANG_DIAGNOSTIC_PUSH()
46#if C10_CLANG_HAS_WARNING("-Wstring-conversion")
47C10_CLANG_DIAGNOSTIC_IGNORE(
"-Wstring-conversion")
49#if C10_CLANG_HAS_WARNING("-Wshorten-64-to-32")
50C10_CLANG_DIAGNOSTIC_IGNORE(
"-Wshorten-64-to-32")
52#if C10_CLANG_HAS_WARNING("-Wimplicit-float-conversion")
53C10_CLANG_DIAGNOSTIC_IGNORE(
"-Wimplicit-float-conversion")
55#if C10_CLANG_HAS_WARNING("-Wimplicit-int-conversion")
56C10_CLANG_DIAGNOSTIC_IGNORE(
"-Wimplicit-int-conversion")
59#define TR2_OPTIONAL_REQUIRES(...) \
60 typename std::enable_if<__VA_ARGS__::value, bool>::type = false
75 typename std::remove_reference<T>::type& t)
noexcept {
76 return static_cast<T&&
>(t);
81 typename std::remove_reference<T>::type&& t)
noexcept {
82 static_assert(!std::is_lvalue_reference<T>::value,
"!!");
83 return static_cast<T&&
>(t);
89 return static_cast<typename std::remove_reference<T>::type&&
>(t);
93#define TR2_OPTIONAL_ASSERTED_EXPRESSION(CHECK, EXPR) (EXPR)
95#define TR2_OPTIONAL_ASSERTED_EXPRESSION(CHECK, EXPR) \
96 ((CHECK) ? (EXPR) : ([] { assert(!#CHECK); }(), (EXPR)))
99#if defined(__CUDA_ARCH__)
100#define TR2_OPTIONAL_HOST_CONSTEXPR
102#define TR2_OPTIONAL_HOST_CONSTEXPR constexpr
112#if (defined _MSC_VER)
114T* static_addressof(T& ref) {
115 return std::addressof(ref);
120struct has_overloaded_addressof {
122 constexpr static bool has_overload(...) {
126 template <class X, size_t S = sizeof(std::declval<X&>().operator&())>
127 constexpr static bool has_overload(
bool) {
131 constexpr static bool value = has_overload<T>(
true);
134template <
typename T, TR2_OPTIONAL_REQUIRES(!has_overloaded_addressof<T>)>
135constexpr T* static_addressof(T& ref) {
139template <
typename T, TR2_OPTIONAL_REQUIRES(has_overloaded_addressof<T>)>
140T* static_addressof(T& ref) {
141 return std::addressof(ref);
148constexpr U convert(U v) {
169 : logic_error{what_arg} {}
178#if __cplusplus >= 202002L
182 new (&
dummy_)
unsigned char;
185 template <
class... Args>
197#if __cplusplus >= 202002L
201 new (&
dummy_)
unsigned char;
207 template <
class... Args>
224 ::new (dataptr()) T(v.
storage_.value_);
231 std::is_nothrow_move_constructible<T>::value)
234 ::new (dataptr()) T(std::move(v.storage_.value_));
241 template <
class... Args>
251 std::initializer_list<U> il,
260 ::new (dataptr()) T(rhs.
storage_.value_);
268 std::is_nothrow_move_assignable<T>::value&&
269 std::is_nothrow_move_constructible<T>::value) {
270 if (
init_ && !rhs.init_) {
272 }
else if (!
init_ && rhs.init_) {
274 ::new (dataptr()) T(std::move(rhs.storage_.value_));
275 }
else if (
init_ && rhs.init_) {
276 storage_.value_ = std::move(rhs.storage_.value_);
295 typename std::remove_const<T>::type* dataptr() {
296 return std::addressof(
storage_.value_);
299 constexpr const T* dataptr()
const {
300 return detail_::static_addressof(
storage_.value_);
303 void clear() noexcept {
323 ::new (dataptr()) T(v.
storage_.value_);
329 v)
noexcept(std::is_nothrow_move_constructible<T>::value)
332 ::new (dataptr()) T(std::move(v.storage_.value_));
342 template <
class... Args>
352 std::initializer_list<U> il,
363 ::new (dataptr()) T(rhs.
storage_.value_);
371 std::is_nothrow_move_assignable<T>::value&&
372 std::is_nothrow_move_constructible<T>::value) {
373 if (
init_ && !rhs.init_) {
375 }
else if (!
init_ && rhs.init_) {
377 ::new (dataptr()) T(std::move(rhs.storage_.value_));
378 }
else if (
init_ && rhs.init_) {
379 storage_.value_ = std::move(rhs.storage_.value_);
392 typename std::remove_const<T>::type* dataptr() {
393 return std::addressof(
storage_.value_);
396 constexpr const T* dataptr()
const {
397 return detail_::static_addressof(
storage_.value_);
400 void clear() noexcept {
422 template <
class... Args>
434 std::initializer_list<U> il,
456template <
class ArrayRefT>
463 const void*
p =
nullptr;
479 template <
typename T>
480 explicit constexpr storage(
const std::initializer_list<T>& v) :
value_(v) {}
482 template <
class... Args>
493 template <
class... Args>
497 template <
typename T>
500 const std::initializer_list<T>& v)
530 std::is_trivially_destructible<T>::value &&
531 C10_IS_TRIVIALLY_COPYABLE(T) &&
536 std::is_copy_constructible<
538 std::is_copy_assignable<
542 std::is_trivially_destructible<T>::value,
551 using OptionalBase = std::conditional_t<
555 std::is_trivially_destructible<U>::value &&
556 C10_IS_TRIVIALLY_COPYABLE(U) &&
562 std::is_copy_constructible<
564 std::is_copy_assignable<
568 std::is_trivially_destructible<U>::value,
579 !std::is_same<typename std::decay<T>::type, in_place_t>
::value,
582 constexpr bool initialized()
const noexcept {
583 return OptionalBase<T>::initialized();
585 typename std::remove_const<T>::type* dataptr() {
586 return std::addressof(OptionalBase<T>::storage_.value_);
588 constexpr const T* dataptr()
const {
589 return detail_::static_addressof(OptionalBase<T>::storage_.value_);
592 constexpr const T& contained_val()
const& {
593 return OptionalBase<T>::storage_.value_;
595 constexpr T&& contained_val() && {
596 return std::move(OptionalBase<T>::storage_.value_);
598 constexpr T& contained_val() & {
599 return OptionalBase<T>::storage_.value_;
602 void clear()
noexcept {
605 OptionalBase<T>::setInitialized(
false);
608 template <
class... Args>
609 void initialize(Args&&... args)
noexcept(
610 noexcept(T(std::forward<Args>(args)...))) {
611 assert(!initialized());
612 ::new (
static_cast<void*
>(dataptr())) T(std::forward<Args>(args)...);
613 OptionalBase<T>::setInitialized(
true);
616 template <
class U,
class... Args>
617 void initialize(std::initializer_list<U> il, Args&&... args)
noexcept(
618 noexcept(T(il, std::forward<Args>(args)...))) {
619 assert(!initialized());
620 ::new (
static_cast<void*
>(dataptr())) T(il, std::forward<Args>(args)...);
621 OptionalBase<T>::setInitialized(
true);
643 std::is_constructible<T, U&&>::value &&
644 !std::is_same<
typename std::decay<U>::type, in_place_t>
::value &&
646 std::is_convertible<U&&, T>)>
647 constexpr optional(U&& u) : OptionalBase<T>(
std::forward<U>(u)) {}
653 std::is_constructible<T, U&&>::value &&
654 !std::is_same<
typename std::decay<U>::type, in_place_t>
::value &&
656 !std::is_convertible<U&&, T>)>
657 explicit constexpr optional(U&& u) : OptionalBase<T>(
std::forward<U>(u)) {}
659 template <
class... Args>
660 explicit constexpr optional(in_place_t, Args&&... args)
669 std::initializer_list<U> il,
686 template <
class U = T>
688 std::is_constructible<T, U>::value &&
690 (std::is_scalar<T>::value ||
691 std::is_same<typename std::decay<U>::type, T>
::value) &&
692 std::is_assignable<T&, U>::value,
695 contained_val() = std::forward<U>(v);
697 initialize(std::forward<U>(v));
702 template <
class... Args>
705 initialize(std::forward<Args>(args)...);
708 template <
class U,
class... Args>
709 void emplace(std::initializer_list<U> il, Args&&... args) {
711 initialize<U, Args...>(il, std::forward<Args>(args)...);
716 std::is_nothrow_move_constructible<T>::value&&
noexcept(
717 std::swap(std::declval<T&>(), std::declval<T&>()))) {
718 if (initialized() ==
true && rhs.initialized() ==
false) {
719 rhs.initialize(std::move(**
this));
721 }
else if (initialized() ==
false && rhs.initialized() ==
true) {
722 initialize(std::move(*rhs));
724 }
else if (initialized() ==
true && rhs.initialized() ==
true) {
732 explicit constexpr operator bool() const noexcept {
733 return initialized();
736 return initialized();
744 assert(initialized());
753 assert(initialized());
754 return contained_val();
758 assert(initialized());
777 return std::move(contained_val());
782 return *
this ? **this : detail_::convert<T>(constexpr_forward<V>(v));
789 : detail_::convert<T>(constexpr_forward<V>(v));
798template <
class T,
class F>
802 typename guts::infer_function_traits_t<F>::return_type,
804 "func parameters must be a callable that returns a type convertible to the value stored in the optional");
805 return v.
has_value() ? *v : detail_::convert<T>(std::forward<F>(func)());
808template <
class T,
class F>
812 typename guts::infer_function_traits_t<F>::return_type,
814 "func parameters must be a callable that returns a type convertible to the value stored in the optional");
815 return v.has_value() ?
constexpr_move(std::move(v).contained_val())
816 : detail_::convert<T>(std::forward<F>(func)());
833 "optional references is ill-formed, \
834 consider use optional of a std::reference_wrapper of type T to \
835 hold a reference if you really need to");
837 static_assert(!std::is_same<T, nullopt_t>::value,
"bad T");
838 static_assert(!std::is_same<T, in_place_t>::value,
"bad T");
847 template <
typename U = T>
848 constexpr optional(U& u) noexcept : ref(detail_::static_addressof(u)) {}
850 template <
typename U = T>
855 explicit constexpr optional(in_place_t, T& v) noexcept
856 : ref(detail_::static_addressof(v)) {}
878 template <
typename U>
879 auto operator=(U&& rhs)
noexcept ->
typename std::enable_if<
880 std::is_same<typename std::decay<U>::type,
optional<T&>>::value,
886 template <
typename U>
887 auto operator=(U&& rhs)
noexcept ->
typename std::enable_if<
888 !std::is_same<typename std::decay<U>::type,
optional<T&>>::value,
892 ref = detail_::static_addressof(v);
898 std::swap(ref, rhs.ref);
915 explicit constexpr operator bool() const noexcept {
916 return ref !=
nullptr;
920 return ref !=
nullptr;
924 constexpr typename std::decay<T>::type
value_or(V&& v)
const {
925 return *
this ? **this
926 : detail_::convert<typename std::decay<T>::type>(
927 constexpr_forward<V>(v));
938 static_assert(
sizeof(T) == 0,
"optional rvalue references disallowed");
944 return bool(x) != bool(y) ? false : bool(x) ==
false ? true : *x == *y;
954 return (!y) ? false : (!x) ?
true : *x < *y;
1034template <
class T,
class U>
1036 return bool(x) ? *x == v :
false;
1039template <
class T,
class U>
1041 return bool(x) ? v == *x :
false;
1044template <
class T,
class U>
1046 return bool(x) ? *x != v :
true;
1049template <
class T,
class U>
1051 return bool(x) ? v != *x :
true;
1054template <
class T,
class U>
1056 return bool(x) ? *x < v :
true;
1059template <
class T,
class U>
1061 return bool(x) ? v > *x :
true;
1064template <
class T,
class U>
1066 return bool(x) ? *x > v :
false;
1069template <
class T,
class U>
1071 return bool(x) ? v < *x :
false;
1074template <
class T,
class U>
1076 return bool(x) ? *x >= v :
false;
1079template <
class T,
class U>
1081 return bool(x) ? v <= *x :
false;
1084template <
class T,
class U>
1086 return bool(x) ? *x <= v :
true;
1089template <
class T,
class U>
1091 return bool(x) ? v >= *x :
true;
1097 return bool(x) ? *x == v :
false;
1102 return bool(x) ? v == *x :
false;
1107 return bool(x) ? *x != v :
true;
1112 return bool(x) ? v != *x :
true;
1117 return bool(x) ? *x < v :
true;
1122 return bool(x) ? v > *x :
true;
1127 return bool(x) ? *x > v :
false;
1132 return bool(x) ? v < *x :
false;
1137 return bool(x) ? *x >= v :
false;
1142 return bool(x) ? v <= *x :
false;
1147 return bool(x) ? *x <= v :
true;
1152 return bool(x) ? v >= *x :
true;
1158 return bool(x) ? *x == v :
false;
1163 return bool(x) ? v == *x :
false;
1168 return bool(x) ? *x != v :
true;
1173 return bool(x) ? v != *x :
true;
1178 return bool(x) ? *x < v :
true;
1183 return bool(x) ? v > *x :
true;
1188 return bool(x) ? *x > v :
false;
1193 return bool(x) ? v < *x :
false;
1198 return bool(x) ? *x >= v :
false;
1203 return bool(x) ? v <= *x :
false;
1208 return bool(x) ? *x <= v :
true;
1213 return bool(x) ? v >= *x :
true;
1235template <
typename T>
1236struct hash<
c10::optional<T>> {
1237 typedef c10::invoke_result_t<std::hash<T>, T>
result_type;
1240 constexpr result_type operator()(argument_type
const& arg)
const {
1241 return arg ? std::hash<T>{}(*arg) :
result_type{};
1245template <
typename T>
1246struct hash<
c10::optional<T&>> {
1247 typedef typename hash<T>::result_type
result_type;
1250 constexpr result_type operator()(argument_type
const& arg)
const {
1251 return arg ? std::hash<T>{}(*arg) :
result_type{};
1256#undef TR2_OPTIONAL_REQUIRES
1257#undef TR2_OPTIONAL_ASSERTED_EXPRESSION
1258#undef TR2_OPTIONAL_HOST_CONSTEXPR
1260C10_CLANG_DIAGNOSTIC_POP()
#define TR2_OPTIONAL_REQUIRES(...)
Definition: Optional.h:59
#define TR2_OPTIONAL_HOST_CONSTEXPR
Definition: Optional.h:102
#define TR2_OPTIONAL_ASSERTED_EXPRESSION(CHECK, EXPR)
Definition: Optional.h:95
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:40
Definition: Optional.h:457
constexpr bool initialized() const noexcept
Definition: Optional.h:503
storage storage_
Definition: Optional.h:487
constexpr arrayref_optional_base(in_place_t, const std::initializer_list< T > &v)
Definition: Optional.h:498
constexpr arrayref_optional_base(in_place_t, Args &&... args)
Definition: Optional.h:494
void setInitialized(bool init) noexcept
Definition: Optional.h:508
constexpr arrayref_optional_base() noexcept=default
Definition: Optional.h:166
bad_optional_access(const char *what_arg)
Definition: Optional.h:170
bad_optional_access(const std::string &what_arg)
Definition: Optional.h:168
constexpr optional(const optional &rhs) noexcept
Definition: Optional.h:853
auto operator=(U &&rhs) noexcept -> typename std::enable_if< std::is_same< typename std::decay< U >::type, optional< T & > >::value, optional & >::type
Definition: Optional.h:879
constexpr T & operator*() const
Definition: Optional.h:906
constexpr std::decay< T >::type value_or(V &&v) const
Definition: Optional.h:924
void swap(optional< T & > &rhs) noexcept
Definition: Optional.h:897
void emplace(T &v) noexcept
Definition: Optional.h:891
constexpr T & value() const
Definition: Optional.h:910
constexpr optional(nullopt_t) noexcept
Definition: Optional.h:845
auto operator=(U &&rhs) noexcept -> typename std::enable_if< !std::is_same< typename std::decay< U >::type, optional< T & > >::value, optional & >::type=delete
constexpr bool has_value() const noexcept
Definition: Optional.h:919
optional & operator=(nullopt_t) noexcept
Definition: Optional.h:863
constexpr optional(in_place_t, T &v) noexcept
Definition: Optional.h:855
void emplace(T &&)=delete
constexpr optional() noexcept
Definition: Optional.h:843
constexpr optional(U &u) noexcept
Definition: Optional.h:848
void reset() noexcept
Definition: Optional.h:931
optional(in_place_t, T &&)=delete
constexpr T * operator->() const
Definition: Optional.h:902
Definition: Optional.h:549
T value_type
Definition: Optional.h:625
constexpr T & value() &
Definition: Optional.h:768
void emplace(std::initializer_list< U > il, Args &&... args)
Definition: Optional.h:709
constexpr T const * operator->() const
Definition: Optional.h:739
void swap(optional< T > &rhs) noexcept(std::is_nothrow_move_constructible< T >::value &&noexcept(std::swap(std::declval< T & >(), std::declval< T & >())))
Definition: Optional.h:715
auto operator=(U &&v) -> typename std::enable_if< std::is_constructible< T, U >::value &&!std::is_same< typename std::decay< U >::type, optional< T > >::value &&(std::is_scalar< T >::value||std::is_same< typename std::decay< U >::type, T >::value) &&std::is_assignable< T &, U >::value, optional & >::type
Definition: Optional.h:687
void emplace(Args &&... args)
Definition: Optional.h:703
constexpr optional() noexcept=default
constexpr T const & value() const &
Definition: Optional.h:762
constexpr optional(U &&u)
Definition: Optional.h:647
constexpr bool has_value() const noexcept
Definition: Optional.h:735
optional & operator=(optional &&rhs)=default
optional & operator=(nullopt_t) noexcept
Definition: Optional.h:677
constexpr T const & operator*() const &
Definition: Optional.h:748
constexpr T && operator*() &&
Definition: Optional.h:757
optional(const optional &rhs)=default
constexpr T & operator*() &
Definition: Optional.h:752
constexpr T && value() &&
Definition: Optional.h:774
constexpr T value_or(V &&v) &&
Definition: Optional.h:786
constexpr optional(in_place_t, Args &&... args)
Definition: Optional.h:660
optional & operator=(const optional &rhs)=default
constexpr T value_or(V &&v) const &
Definition: Optional.h:781
constexpr optional(in_place_t, std::initializer_list< U > il, Args &&... args)
Definition: Optional.h:667
optional(optional &&rhs)=default
void reset() noexcept
Definition: Optional.h:793
constexpr T * operator->()
Definition: Optional.h:743
at::ScalarType result_type(const at::Tensor &tensor, const at::Tensor &other)
Definition: Functions.h:9174
bool operator!=(c10::ArrayRef< T > a1, c10::ArrayRef< T > a2)
Definition: ArrayRef.h:340
constexpr bool operator<=(const optional< T > &x, const optional< T > &y)
Definition: Optional.h:963
constexpr bool operator>(const optional< T > &x, const optional< T > &y)
Definition: Optional.h:958
constexpr nullopt_t nullopt
Definition: Optional.h:163
constexpr optional< typename std::decay< T >::type > make_optional(T &&v)
Definition: Optional.h:1223
constexpr T value_or_else(const optional< T > &v, F &&func)
Definition: Optional.h:799
constexpr std::remove_reference< T >::type && constexpr_move(T &&t) noexcept
Definition: Optional.h:87
constexpr T && constexpr_forward(typename std::remove_reference< T >::type &t) noexcept
Definition: Optional.h:74
constexpr bool operator<(const optional< T > &x, const optional< T > &y)
Definition: Optional.h:953
constexpr bool operator>=(const optional< T > &x, const optional< T > &y)
Definition: Optional.h:968
std::conditional_t< detail_::is_arrayref< T >::value, arrayref_optional_base< T >, std::conditional_t< std::is_trivially_destructible< T >::value &&std::is_trivially_copyable< T >::value &&std::is_copy_constructible< trivially_copyable_optimization_optional_base< T > >::value &&std::is_copy_assignable< trivially_copyable_optimization_optional_base< T > >::value, trivially_copyable_optimization_optional_base< T >, std::conditional_t< std::is_trivially_destructible< T >::value, constexpr_optional_base< std::remove_const_t< T > >, optional_base< std::remove_const_t< T > > > > > OptionalBase
Definition: Optional.h:546
void swap(optional< T > &x, optional< T > &y) noexcept(noexcept(x.swap(y)))
Definition: Optional.h:1218
bool operator==(c10::ArrayRef< T > a1, c10::ArrayRef< T > a2)
Definition: ArrayRef.h:335
constexpr struct c10::trivial_init_t trivial_init
Definition: Optional.h:460
const void * p
Definition: Optional.h:463
size_t sz
Definition: Optional.h:464
Definition: Optional.h:312
constexpr_optional_base & operator=(constexpr_optional_base &&rhs) noexcept(std::is_nothrow_move_assignable< T >::value &&std::is_nothrow_move_constructible< T >::value)
Definition: Optional.h:370
constexpr constexpr_optional_base(const constexpr_optional_base< T > &v)
Definition: Optional.h:319
~constexpr_optional_base()=default
bool init_
Definition: Optional.h:313
constexpr_optional_base & operator=(const constexpr_optional_base &rhs)
Definition: Optional.h:358
constexpr constexpr_optional_base(T &&v)
Definition: Optional.h:339
constexpr bool initialized() const noexcept
Definition: Optional.h:384
constexpr constexpr_optional_base(in_place_t, std::initializer_list< U > il, Args &&... args)
Definition: Optional.h:350
void setInitialized(bool init) noexcept
Definition: Optional.h:387
constexpr_storage_t< T > storage_
Definition: Optional.h:314
constexpr constexpr_optional_base(in_place_t, Args &&... args)
Definition: Optional.h:343
constexpr constexpr_optional_base() noexcept
Definition: Optional.h:316
constexpr constexpr_optional_base(const T &v)
Definition: Optional.h:336
constexpr constexpr_optional_base(constexpr_optional_base< T > &&v) noexcept(std::is_nothrow_move_constructible< T >::value)
Definition: Optional.h:327
Definition: Optional.h:519
Definition: Optional.h:160
constexpr nullopt_t(int)
Definition: Optional.h:161
Definition: Optional.h:215
constexpr bool initialized() const noexcept
Definition: Optional.h:286
optional_base(in_place_t, Args &&... args)
Definition: Optional.h:242
constexpr optional_base(optional_base< T > &&v) noexcept(std::is_nothrow_move_constructible< T >::value)
Definition: Optional.h:230
~optional_base()
Definition: Optional.h:281
constexpr optional_base() noexcept
Definition: Optional.h:219
optional_base(in_place_t, std::initializer_list< U > il, Args &&... args)
Definition: Optional.h:249
constexpr optional_base(const optional_base< T > &v)
Definition: Optional.h:221
void setInitialized(bool init) noexcept
Definition: Optional.h:290
constexpr optional_base(T &&v)
Definition: Optional.h:238
bool init_
Definition: Optional.h:216
constexpr optional_base(const T &v)
Definition: Optional.h:228
storage_t< T > storage_
Definition: Optional.h:217
optional_base & operator=(optional_base &&rhs) noexcept(std::is_nothrow_move_assignable< T >::value &&std::is_nothrow_move_constructible< T >::value)
Definition: Optional.h:267
optional_base & operator=(const optional_base &rhs)
Definition: Optional.h:255
Definition: Optional.h:156
Definition: Optional.h:409
bool init_
Definition: Optional.h:410
constexpr trivially_copyable_optimization_optional_base(T &&v)
Definition: Optional.h:419
~trivially_copyable_optimization_optional_base()=default
constexpr trivially_copyable_optimization_optional_base(const T &v)
Definition: Optional.h:416
constexpr_storage_t< T > storage_
Definition: Optional.h:411
constexpr trivially_copyable_optimization_optional_base(in_place_t, std::initializer_list< U > il, Args &&... args)
Definition: Optional.h:432
constexpr trivially_copyable_optimization_optional_base() noexcept
Definition: Optional.h:413
constexpr trivially_copyable_optimization_optional_base(in_place_t, Args &&... args)
Definition: Optional.h:423
constexpr bool initialized() const noexcept
Definition: Optional.h:440
void setInitialized(bool init) noexcept
Definition: Optional.h:443
Definition: Optional.h:459
constexpr storage(ArrayRefT &v)
Definition: Optional.h:477
struct c10::arrayref_optional_base::storage::raw uninitialized_
constexpr storage(Args &&... args)
Definition: Optional.h:483
constexpr void setUninitialized() noexcept
Definition: Optional.h:472
ArrayRefT value_
Definition: Optional.h:466
constexpr storage() noexcept
Definition: Optional.h:468
constexpr storage(const std::initializer_list< T > &v)
Definition: Optional.h:480
Definition: Optional.h:193
constexpr constexpr_storage_t(Args &&... args)
Definition: Optional.h:208
~constexpr_storage_t()=default
constexpr constexpr_storage_t(trivial_init_t) noexcept
Definition: Optional.h:204
T value_
Definition: Optional.h:195
unsigned char dummy_
Definition: Optional.h:194
Definition: Optional.h:174
unsigned char dummy_
Definition: Optional.h:175
constexpr storage_t(Args &&... args)
Definition: Optional.h:186
~storage_t()
Definition: Optional.h:189
T value_
Definition: Optional.h:176
storage_t(trivial_init_t) noexcept
Definition: Optional.h:181