refactor(typetraits): replaces template class type traits with alias template for TypeTraits/Miscellaneous.h

This commit is contained in:
2022-05-22 22:52:47 +08:00
parent 97910be70c
commit 2ce259e7cc
16 changed files with 233 additions and 236 deletions

View File

@ -48,7 +48,7 @@ public:
}
template <typename T = OptionalType> requires CConstructibleFrom<OptionalType, T&&>
&& (!CSameAs<typename TRemoveCVRef<T>::Type, FInPlace>) && (!CSameAs<typename TRemoveCVRef<T>::Type, TOptional>)
&& (!CSameAs<TRemoveCVRef<T>, FInPlace>) && (!CSameAs<TRemoveCVRef<T>, TOptional>)
constexpr explicit (!CConvertibleTo<T&&, OptionalType>) TOptional(T&& InValue)
: TOptional(InPlace, Forward<T>(InValue))
{ }
@ -246,7 +246,7 @@ public:
private:
TAlignedStorage<sizeof(OptionalType), alignof(OptionalType)>::Type Value;
TAlignedStorage<sizeof(OptionalType), alignof(OptionalType)> Value;
bool bIsValid;
};
@ -283,9 +283,9 @@ constexpr bool operator==(const TOptional<T>& LHS, FInvalid)
}
template <typename T> requires CDestructible<T>
constexpr TOptional<typename TDecay<T>::Type> MakeOptional(FInvalid)
constexpr TOptional<TDecay<T>> MakeOptional(FInvalid)
{
return TOptional<typename TDecay<T>::Type>(Invalid);
return TOptional<TDecay<T>>(Invalid);
}
template <typename T> requires CDestructible<T> && CConstructibleFrom<T, T&&>