Template Class Optional
Defined in File Optional.h
Class Documentation
-
template<typename T>
class Optional Simple DLL-safe container holding an optional object.
Simple optional type used to pass optional object across the DLL boundary.
- Template Parameters
T – : Object type to store in the optional
Public Functions
-
inline Optional()
Constructs an optional with a null value.
-
inline Optional(T *InValue, std::function<void(T*)> InValueDestructor = DefaultDestructor<T>)
Constructs an optional with a given pointer.
- Parameters
InValue – T* : Pointer to construct optional with
InValueDestructor – std::function<void(T*)> : Optional deleter to be called on destructer
-
inline Optional(std::nullptr_t InValue)
Constructs an optional with a null value.
- Parameters
InValue – std::nullptr_t : nullptr value
-
template<typename U>
inline Optional(const U &InValue) Constructs an optional by copying given value of a different type.
- Parameters
InValue – const U& : Reference to construct optional with
-
inline Optional(const T &InValue)
Constructs an optional with a given reference.
- Parameters
InValue – const T& : Reference to construct optional with
-
inline Optional(T &&InValue)
Constructs an optional with a given rvalue reference.
- Parameters
InValue – T&& : Rvalue reference to construct optional with
-
inline ~Optional()
Destructor.
-
inline bool HasValue() const
Checks of the options contains a value (non null).
- Returns
bool
-
inline Optional<T> &operator=(const T &InValue)
Assigns a value to the optional.
- Parameters
Other – const T& : Reference to assign to optional
- Returns
Optional<T>&