feat(templates): add Ref helper function for TReferenceWrapper
This commit is contained in:
parent
f72d6a53d8
commit
ff59698fdc
@ -40,6 +40,33 @@ private:
|
||||
template <typename T>
|
||||
TReferenceWrapper(T&) -> TReferenceWrapper<T>;
|
||||
|
||||
template <typename T>
|
||||
void Ref(const T&&) = delete;
|
||||
|
||||
template <typename T>
|
||||
constexpr TReferenceWrapper<T> Ref(T& InValue)
|
||||
{
|
||||
return TReferenceWrapper<T>(InValue);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
constexpr TReferenceWrapper<T> Ref(TReferenceWrapper<T> InValue)
|
||||
{
|
||||
return Ref(InValue.Get());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
constexpr TReferenceWrapper<const T> Ref(const T& InValue)
|
||||
{
|
||||
return TReferenceWrapper<const T>(InValue);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
constexpr TReferenceWrapper<const T> Ref(TReferenceWrapper<T> InValue)
|
||||
{
|
||||
return Ref(InValue.Get());
|
||||
}
|
||||
|
||||
template <typename T> struct TIsTReferenceWrapper : FFalse { };
|
||||
template <typename T> struct TIsTReferenceWrapper<TReferenceWrapper<T>> : FTrue { };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user