UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
uLang::TOptional< OptionalType > Struct Template Reference

#include <Optional.h>

Public Member Functions

 TOptional (const OptionalType &Value)
 
 TOptional (OptionalType &&Value)
 
 TOptional (EResult Result=EResult::Unspecified)
 
 ~TOptional ()
 
 TOptional (const TOptional &Value)
 
 TOptional (TOptional &&Value)
 
TOptionaloperator= (const TOptional &Value)
 
TOptionaloperator= (TOptional &&Value)
 
TOptionaloperator= (const OptionalType &Value)
 
TOptionaloperator= (OptionalType &&Value)
 
void Reset ()
 
template<typename... ArgsType>
void Emplace (ArgsType &&... Args)
 
ULANG_FORCEINLINE bool IsSet () const
 
ULANG_FORCEINLINE EResult GetResult () const
 
ULANG_FORCEINLINE operator bool () const
 
ULANG_FORCEINLINE operator OptionalType * ()
 
ULANG_FORCEINLINE operator const OptionalType * () const
 
const OptionalTypeGetValue () const
 
OptionalTypeGetValue ()
 
const OptionalTypeoperator* () const
 
OptionalTypeoperator* ()
 
const OptionalTypeoperator-> () const
 
OptionalTypeoperator-> ()
 
const OptionalTypeGet (const OptionalType &DefaultValue) const
 

Friends

bool operator== (const TOptional &lhs, const TOptional &rhs)
 
bool operator!= (const TOptional &lhs, const TOptional &rhs)
 

Detailed Description

template<typename OptionalType>
struct uLang::TOptional< OptionalType >

When we have an optional value IsSet() returns true, and GetValue() is meaningful. Otherwise GetValue() is not meaningful.

Constructor & Destructor Documentation

◆ TOptional() [1/5]

Construct an OptionaType with a valid value.

◆ TOptional() [2/5]

◆ TOptional() [3/5]

Construct an OptionalType with no value; i.e. unset

◆ ~TOptional()

◆ TOptional() [4/5]

Copy/Move construction

◆ TOptional() [5/5]

Member Function Documentation

◆ Emplace()

template<typename OptionalType >
template<typename... ArgsType>
void uLang::TOptional< OptionalType >::Emplace ( ArgsType &&...  Args)
inline

◆ Get()

template<typename OptionalType >
const OptionalType & uLang::TOptional< OptionalType >::Get ( const OptionalType DefaultValue) const
inline
Returns
The optional value when set; DefaultValue otherwise.

◆ GetResult()

template<typename OptionalType >
ULANG_FORCEINLINE EResult uLang::TOptional< OptionalType >::GetResult ( ) const
inline

◆ GetValue() [1/2]

template<typename OptionalType >
OptionalType & uLang::TOptional< OptionalType >::GetValue ( )
inline

◆ GetValue() [2/2]

template<typename OptionalType >
const OptionalType & uLang::TOptional< OptionalType >::GetValue ( ) const
inline
Returns
The optional value; undefined when IsSet() returns false.

◆ IsSet()

Returns
true when the value is meaningful; false if calling GetValue() is undefined.

◆ operator bool()

template<typename OptionalType >
ULANG_FORCEINLINE uLang::TOptional< OptionalType >::operator bool ( ) const
inlineexplicit

◆ operator const OptionalType *()

template<typename OptionalType >
ULANG_FORCEINLINE uLang::TOptional< OptionalType >::operator const OptionalType * ( ) const
inline

◆ operator OptionalType *()

◆ operator*() [1/2]

template<typename OptionalType >
OptionalType & uLang::TOptional< OptionalType >::operator* ( )
inline

◆ operator*() [2/2]

template<typename OptionalType >
const OptionalType & uLang::TOptional< OptionalType >::operator* ( ) const
inline
Returns
The optional value; undefined when IsSet() returns false.

◆ operator->() [1/2]

template<typename OptionalType >
OptionalType * uLang::TOptional< OptionalType >::operator-> ( )
inline

◆ operator->() [2/2]

template<typename OptionalType >
const OptionalType * uLang::TOptional< OptionalType >::operator-> ( ) const
inline

◆ operator=() [1/4]

template<typename OptionalType >
TOptional & uLang::TOptional< OptionalType >::operator= ( const OptionalType Value)
inline

◆ operator=() [2/4]

template<typename OptionalType >
TOptional & uLang::TOptional< OptionalType >::operator= ( const TOptional< OptionalType > &  Value)
inline

◆ operator=() [3/4]

template<typename OptionalType >
TOptional & uLang::TOptional< OptionalType >::operator= ( OptionalType &&  Value)
inline

◆ operator=() [4/4]

template<typename OptionalType >
TOptional & uLang::TOptional< OptionalType >::operator= ( TOptional< OptionalType > &&  Value)
inline

◆ Reset()

template<typename OptionalType >
void uLang::TOptional< OptionalType >::Reset ( )
inline

Friends And Related Symbol Documentation

◆ operator!=

template<typename OptionalType >
bool operator!= ( const TOptional< OptionalType > &  lhs,
const TOptional< OptionalType > &  rhs 
)
friend

◆ operator==

template<typename OptionalType >
bool operator== ( const TOptional< OptionalType > &  lhs,
const TOptional< OptionalType > &  rhs 
)
friend

The documentation for this struct was generated from the following file: