feat(templates): add TOptional and TVariant to compare the equivalence of Invalid
This commit is contained in:
@ -249,6 +249,30 @@ constexpr bool operator!=(const T& LHS, const TOptional<U>& RHS)
|
||||
return RHS.IsValid() ? LHS != *RHS : true;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
constexpr bool operator==(const TOptional<T>& LHS, FInvalid)
|
||||
{
|
||||
return !LHS.IsValid();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
constexpr bool operator!=(const TOptional<T>& LHS, FInvalid)
|
||||
{
|
||||
return LHS.IsValid();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
constexpr bool operator==(FInvalid, const TOptional<T>& RHS)
|
||||
{
|
||||
return !RHS.IsValid();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
constexpr bool operator!=(FInvalid, const TOptional<T>& RHS)
|
||||
{
|
||||
return RHS.IsValid();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
constexpr TOptional<typename TDecay<T>::Type> MakeOptional(FInvalid)
|
||||
{
|
||||
|
Reference in New Issue
Block a user