72template <typename Value>
75 template <
typename T,
typename U>
78 static constexpr auto value = ! std::is_constructible<T, Optional<U>&>
::value
79 && ! std::is_constructible<T, const Optional<U>&>
::value
80 && ! std::is_constructible<T, Optional<U>&&>
::value
81 && ! std::is_constructible<T, const Optional<U>&&>
::value
82 && ! std::is_convertible<Optional<U>&, T>
::value
83 && ! std::is_convertible<const Optional<U>&, T>
::value
84 && ! std::is_convertible<Optional<U>&&, T>
::value
85 && ! std::is_convertible<const Optional<U>&&, T>
::value;
88 template <
typename T,
typename U>
91 template <
typename T,
typename U>
94 template <
typename T,
typename U>
96 && ! std::is_assignable<T&, Optional<U>&>
::value
97 && ! std::is_assignable<T&, const Optional<U>&>
::value
98 && ! std::is_assignable<T&, Optional<U>&&>
::value
99 && ! std::is_assignable<T&, const Optional<U>&&>
::value;
101 template <
typename T,
typename U>
103 && std::is_assignable<T&, const U&>::value
106 template <
typename T,
typename U>
108 && std::is_nothrow_assignable<T&, U>::value
116 template <
typename U =
Value,
117 typename = std::enable_if_t<std::is_constructible<Value, U&&>::value
124 Optional (
Optional&& other)
noexcept (
noexcept (std::declval<Optional>().constructFrom (other)))
137 template <
typename Other,
typename = OptionalMoveConstructorEnabled<Value, Other>>
144 template <
typename Other,
typename = OptionalCopyConstructorEnabled<Value, Other>>
158 template <
typename U =
Value,
159 typename = std::enable_if_t<std::is_nothrow_move_constructible<U>::value
160 && std::is_nothrow_move_assignable<U>::value>>
161 Optional& operator= (
Optional&& other)
noexcept (
noexcept (std::declval<Optional>().assign (std::declval<Optional&>())))
167 template <
typename U =
Value,
168 typename = std::enable_if_t<! std::is_same<std::decay_t<U>,
Optional>
::value
169 && std::is_constructible<Value, U>::value
170 && std::is_assignable<Value&, U>::value
171 && (! std::is_scalar<Value>::value || ! std::is_same<std::decay_t<U>,
Value>
::value)>>
175 **
this = std::forward<U> (
value);
191 template <
typename Other,
typename = OptionalMoveAssignmentEnabled<Value, Other>>
199 template <
typename Other,
typename = OptionalCopyAssignmentEnabled<Value, Other>>
223 if (std::exchange (
valid,
false))
228 template <
typename U>
229 Value orFallback (
U&& fallback)
const {
return *
this ? **this : std::forward<U> (fallback); }
231 template <
typename... Args>
240 void swap (
Optional& other)
noexcept (std::is_nothrow_move_constructible<Value>::value
246 swap (**
this, *other);
248 else if (
hasValue() || other.hasValue())
255 template <
typename Other>
258 if (! other.hasValue())
266 template <
typename Other>
267 void assign (
Optional<Other>& other)
noexcept (
noexcept (std::declval<Value&>() = std::move (*other)) &&
noexcept (std::declval<Optional>().constructFrom (other)))
271 if (other.hasValue())
273 **
this = std::move (*other);
297template <
typename Value>
300 return std::forward<Value> (
v);
303template <
class T,
class U>
311template <
class T,
class U>
319template <
class T,
class U>
327template <
class T,
class U>
335template <
class T,
class U>
343template <
class T,
class U>
376template <
class T,
class U>
378template <
class T,
class U>
380template <
class T,
class U>
382template <
class T,
class U>
384template <
class T,
class U>
386template <
class T,
class U>
388template <
class T,
class U>
390template <
class T,
class U>
392template <
class T,
class U>
394template <
class T,
class U>
396template <
class T,
class U>
398template <
class T,
class U>
#define copy(x)
Definition ADnoteParameters.cpp:1011
#define noexcept
Definition DistrhoDefines.h:72
Definition juce_Optional.h:74
Optional(Nullopt) noexcept
Definition juce_Optional.h:114
~Optional() noexcept
Definition juce_Optional.h:207
Value orFallback(U &&fallback) const
Definition juce_Optional.h:229
Optional(Optional< Other > &&other) noexcept(noexcept(std::declval< Optional >().constructFrom(other)))
Definition juce_Optional.h:138
Value & operator*() noexcept
Definition juce_Optional.h:215
const Value * operator->() const noexcept
Definition juce_Optional.h:213
bool valid
Definition juce_Optional.h:292
const Value & operator*() const noexcept
Definition juce_Optional.h:216
Optional(Optional &&other) noexcept(noexcept(std::declval< Optional >().constructFrom(other)))
Definition juce_Optional.h:124
Optional(U &&value) noexcept(noexcept(Value(std::forward< U >(value))))
Definition juce_Optional.h:119
void reset()
Definition juce_Optional.h:221
Optional(const Optional &other)
Definition juce_Optional.h:130
void swap(Optional &other) noexcept(std::is_nothrow_move_constructible< Value >::value &&detail::adlSwap::isNothrowSwappable< Value >)
Definition juce_Optional.h:240
char placeholder
Definition juce_Optional.h:289
Value storage
Definition juce_Optional.h:290
static auto notAssignableFromSimilarType
Definition juce_Optional.h:95
Optional(const Optional< Other > &other)
Definition juce_Optional.h:145
Value * operator->() noexcept
Definition juce_Optional.h:212
std::enable_if_t< std::is_constructible< T, U && >::value &&NotConstructibleFromSimilarType< T, U >::value > OptionalMoveConstructorEnabled
Definition juce_Optional.h:92
void constructFrom(Optional< Other > &other) noexcept(noexcept(Value(std::move(*other))))
Definition juce_Optional.h:256
Optional()
Definition juce_Optional.h:112
std::enable_if_t< std::is_constructible< T, const U & >::value &&std::is_assignable< T &, const U & >::value &&NotConstructibleFromSimilarType< T, U >::value > OptionalCopyAssignmentEnabled
Definition juce_Optional.h:102
std::enable_if_t< std::is_constructible< T, const U & >::value &&NotConstructibleFromSimilarType< T, U >::value > OptionalCopyConstructorEnabled
Definition juce_Optional.h:89
Value & emplace(Args &&... args)
Definition juce_Optional.h:232
bool hasValue() const noexcept
Definition juce_Optional.h:219
std::enable_if_t< std::is_constructible< T, U >::value &&std::is_nothrow_assignable< T &, U >::value &&NotConstructibleFromSimilarType< T, U >::value > OptionalMoveAssignmentEnabled
Definition juce_Optional.h:107
void assign(Optional< Other > &other) noexcept(noexcept(std::declval< Value & >()=std::move(*other)) &&noexcept(std::declval< Optional >().constructFrom(other)))
Definition juce_Optional.h:267
Definition juce_Value.h:51
unsigned v[N_MAX]
Definition inflate.c:1584
#define U(x)
Definition fmopl.c:132
static PuglViewHint int value
Definition pugl.h:1708
#define JUCE_BEGIN_IGNORE_WARNINGS_MSVC(warnings)
Definition juce_CompilerWarnings.h:198
#define JUCE_END_IGNORE_WARNINGS_MSVC
Definition juce_CompilerWarnings.h:199
Definition juce_Optional.h:29
constexpr auto isNothrowSwappable
Definition juce_Optional.h:33
Definition juce_FloatVectorOperations.h:143
Definition carla_juce.cpp:31
static void swap(ThrowOnMoveOrSwap &, ThrowOnMoveOrSwap &)
Definition juce_Optional_test.cpp:32
JUCE_END_IGNORE_WARNINGS_MSVC Optional< std::decay_t< Value > > makeOptional(Value &&v)
Definition juce_Optional.h:298
constexpr Nullopt nullopt
Definition juce_Optional.h:48
Definition juce_Uuid.h:141
#define true
Definition ordinals.h:82
Definition juce_Optional.h:41
constexpr Nullopt(int)
Definition juce_Optional.h:42
Definition juce_Optional.h:77
static constexpr auto value
Definition juce_Optional.h:78
#define const
Definition zconf.h:137