24.08
|
Go to the documentation of this file.
10 #include <type_traits>
41 #define CONSTRUCT_IN_PLACE armnn::ConstructInPlace{}
61 explicit operator bool() const noexcept
80 template <
bool IsReference,
typename T>
95 template<
class... Args>
120 Construct(other.
value());
153 auto valuePtr =
reinterpret_cast<const T*
>(m_Storage);
164 auto valuePtr =
reinterpret_cast<T*
>(m_Storage);
169 void Construct(
const T&
value)
171 new (m_Storage) T(
value);
175 template<
class... Args>
176 void Construct(ConstructInPlace, Args&&... args)
178 new (m_Storage) T(std::forward<Args>(args)...);
182 alignas(
alignof(T))
unsigned char m_Storage[
sizeof(T)] = {};
190 template <
typename T>
195 using NonRefT =
typename std::remove_reference<T>::type;
211 template<
class... Args>
223 m_Storage = other.m_Storage;
269 template <
typename T>
282 template<
class... Args>
304 template<
typename T,
class... Args>
#define CONSTRUCT_IN_PLACE
OptionalBase(bool hasValue) noexcept
OptionalBase is the common functionality between reference and non-reference optional types.
~OptionalReferenceSwitch()
~OptionalReferenceSwitch()
OptionalReferenceSwitch(EmptyOptional) noexcept
OptionalReferenceSwitch(const T &value)
OptionalReferenceSwitch & operator=(EmptyOptional)
OptionalReferenceSwitch(ConstructInPlace, Args &&... args)
Optional(EmptyOptional empty)
OptionalReferenceSwitch & operator=(EmptyOptional)
OptionalReferenceSwitch & operator=(const OptionalReferenceSwitch &other)
EmptyOptional is used to initialize the Optional class in case we want to have default value for an O...
Disambiguation tag that can be passed to the constructor to indicate that the contained object should...
OptionalReferenceSwitch() noexcept
typename std::remove_reference< T >::type NonRefT
Optional(const BaseSwitch &other)
Optional< T > MakeOptional(Args &&... args)
Utility template that constructs an object of type T in-place and wraps it inside an Optional<T> obje...
ConstructInPlace()=default
Optional & operator=(const Optional &other)=default
OptionalReferenceSwitch(const OptionalReferenceSwitch &other)
bool operator==(const Optional< T > &rhs) const
Two optionals are considered equal if they are both empty or both contain values which themselves are...
OptionalReferenceSwitch & operator=(const T value)
Copyright (c) 2021 ARM Limited and Contributors.
OptionalReferenceSwitch(T value)
OptionalReferenceSwitch(const OptionalReferenceSwitch &other)
OptionalReferenceSwitch() noexcept
OptionalReferenceSwitch & operator=(const T &value)
OptionalReferenceSwitch(EmptyOptional) noexcept
Optional(const Optional &other)
Optional(ConstructInPlace, Args &&... args)
The default implementation is the non-reference case.
OptionalReferenceSwitch & operator=(const OptionalReferenceSwitch &other)
bool has_value() const noexcept