refactor(memory): disable comparison of TUniquePtr and TSharedPtr with nullptr
This commit is contained in:
parent
0c54bbe2ac
commit
fb0d1e978d
@ -291,9 +291,9 @@ void TestUniquePointer()
|
||||
TUniqueRef<FCounter, FDeleter> TempB(PtrB);
|
||||
TUniqueRef<FCounter, FDeleter> TempC(PtrC, FDeleter());
|
||||
|
||||
always_check(TempA == PtrA);
|
||||
always_check(TempA != nullptr);
|
||||
always_check(TempC != TempB);
|
||||
always_check((TempA <=> PtrA) == strong_ordering::equal);
|
||||
always_check((TempA <=> nullptr) == strong_ordering::greater);
|
||||
always_check((TempC <=> TempB) != strong_ordering::equal);
|
||||
|
||||
int32 TempNum;
|
||||
@ -344,9 +344,9 @@ void TestUniquePointer()
|
||||
TUniqueRef<FCounter[], FArrayDeleter> TempB(PtrB);
|
||||
TUniqueRef<FCounter[], FArrayDeleter> TempC(PtrC, FArrayDeleter());
|
||||
|
||||
always_check(TempA == PtrA);
|
||||
always_check(TempA != nullptr);
|
||||
always_check(TempC != TempB);
|
||||
always_check((TempA <=> PtrA) == strong_ordering::equal);
|
||||
always_check((TempA <=> nullptr) == strong_ordering::greater);
|
||||
always_check((TempC <=> TempB) != strong_ordering::equal);
|
||||
|
||||
int32 TempNum;
|
||||
@ -397,9 +397,9 @@ void TestUniquePointer()
|
||||
TUniquePtr<FCounter, FDeleter> TempB(PtrB);
|
||||
TUniquePtr<FCounter, FDeleter> TempC(PtrC, FDeleter());
|
||||
|
||||
always_check(TempA == PtrA);
|
||||
always_check(TempA != nullptr);
|
||||
always_check(TempC != TempB);
|
||||
always_check((TempA <=> PtrA) == strong_ordering::equal);
|
||||
always_check((TempA <=> nullptr) == strong_ordering::greater);
|
||||
always_check((TempC <=> TempB) != strong_ordering::equal);
|
||||
|
||||
int32 TempNum;
|
||||
@ -462,9 +462,9 @@ void TestUniquePointer()
|
||||
TUniquePtr<FCounter[], FArrayDeleter> TempB(PtrB);
|
||||
TUniquePtr<FCounter[], FArrayDeleter> TempC(PtrC, FArrayDeleter());
|
||||
|
||||
always_check(TempA == PtrA);
|
||||
always_check(TempA != nullptr);
|
||||
always_check(TempC != TempB);
|
||||
always_check((TempA <=> PtrA) == strong_ordering::equal);
|
||||
always_check((TempA <=> nullptr) == strong_ordering::greater);
|
||||
always_check((TempC <=> TempB) != strong_ordering::equal);
|
||||
|
||||
int32 TempNum;
|
||||
@ -540,9 +540,9 @@ void TestSharedPointer()
|
||||
TSharedRef<FCounter> TempB(PtrB, FDeleter());
|
||||
TSharedRef<FCounter> TempC(PtrC, FDeleter());
|
||||
|
||||
always_check(TempA == PtrA);
|
||||
always_check(TempA != nullptr);
|
||||
always_check(TempC != TempB);
|
||||
always_check((TempA <=> PtrA) == strong_ordering::equal);
|
||||
always_check((TempA <=> nullptr) == strong_ordering::greater);
|
||||
always_check((TempC <=> TempB) != strong_ordering::equal);
|
||||
|
||||
int32 TempNum;
|
||||
@ -587,9 +587,9 @@ void TestSharedPointer()
|
||||
TSharedRef<FCounter[]> TempB(PtrB, FArrayDeleter());
|
||||
TSharedRef<FCounter[]> TempC(PtrC, FArrayDeleter());
|
||||
|
||||
always_check(TempA == PtrA);
|
||||
always_check(TempA != nullptr);
|
||||
always_check(TempC != TempB);
|
||||
always_check((TempA <=> PtrA) == strong_ordering::equal);
|
||||
always_check((TempA <=> nullptr) == strong_ordering::greater);
|
||||
always_check((TempC <=> TempB) != strong_ordering::equal);
|
||||
|
||||
int32 TempNum;
|
||||
@ -628,9 +628,9 @@ void TestSharedPointer()
|
||||
TSharedPtr<FCounter> TempB(PtrB, FDeleter());
|
||||
TSharedPtr<FCounter> TempC(PtrC, FDeleter());
|
||||
|
||||
always_check(TempA == PtrA);
|
||||
always_check(TempA != nullptr);
|
||||
always_check(TempC != TempB);
|
||||
always_check((TempA <=> PtrA) == strong_ordering::equal);
|
||||
always_check((TempA <=> nullptr) == strong_ordering::greater);
|
||||
always_check((TempC <=> TempB) != strong_ordering::equal);
|
||||
|
||||
int32 TempNum;
|
||||
@ -684,9 +684,9 @@ void TestSharedPointer()
|
||||
TSharedPtr<FCounter[]> TempB(PtrB, FArrayDeleter());
|
||||
TSharedPtr<FCounter[]> TempC(PtrC, FArrayDeleter());
|
||||
|
||||
always_check(TempA == PtrA);
|
||||
always_check(TempA != nullptr);
|
||||
always_check(TempC != TempB);
|
||||
always_check((TempA <=> PtrA) == strong_ordering::equal);
|
||||
always_check((TempA <=> nullptr) == strong_ordering::greater);
|
||||
always_check((TempC <=> TempB) != strong_ordering::equal);
|
||||
|
||||
int32 TempNum;
|
||||
|
@ -636,16 +636,18 @@ public:
|
||||
FORCEINLINE TSharedRef& operator=(TSharedRef<U>&& InValue) { return Helper::MoveSharedReference(*this, MoveTemp(InValue)); }
|
||||
|
||||
/** Compares the pointer values of two TSharedRef. */
|
||||
NODISCARD friend FORCEINLINE constexpr bool operator==(const TSharedRef& LHS, const TSharedRef& RHS) { return LHS.Get() == RHS.Get(); }
|
||||
template <typename U> requires (CEqualityComparable<T*, TRemoveExtent<U>*>)
|
||||
NODISCARD friend FORCEINLINE constexpr bool operator==(const TSharedRef& LHS, const TSharedRef<U>& RHS) { return LHS.Get() == RHS.Get(); }
|
||||
|
||||
/** Compares the pointer values of two TSharedRef. */
|
||||
NODISCARD friend FORCEINLINE constexpr strong_ordering operator<=>(const TSharedRef& LHS, const TSharedRef& RHS) { return LHS.Get() <=> RHS.Get(); }
|
||||
template <typename U> requires (CThreeWayComparable<T*, TRemoveExtent<U>*>)
|
||||
NODISCARD friend FORCEINLINE constexpr strong_ordering operator<=>(const TSharedRef& LHS, const TSharedRef<U>& RHS) { return LHS.Get() <=> RHS.Get(); }
|
||||
|
||||
/** Compares the pointer values with a raw pointer. */
|
||||
NODISCARD FORCEINLINE constexpr bool operator==(T* InPtr) const& { return Get() == InPtr; }
|
||||
/** Compares the pointer values with nullptr. */
|
||||
NODISCARD FORCEINLINE constexpr bool operator==(nullptr_t) const& { return Get() == nullptr; }
|
||||
|
||||
/** Compares the pointer values with a raw pointer. */
|
||||
NODISCARD FORCEINLINE constexpr strong_ordering operator<=>(T* InPtr) const& { return Get() <=> InPtr; }
|
||||
/** Compares the pointer values with nullptr. */
|
||||
NODISCARD FORCEINLINE constexpr strong_ordering operator<=>(nullptr_t) const& { return Get() <=> static_cast<T*>(nullptr); }
|
||||
|
||||
/** TSharedRef cannot be initialized by nullptr. */
|
||||
void Reset(nullptr_t) = delete;
|
||||
@ -852,18 +854,18 @@ public:
|
||||
FORCEINLINE TSharedRef& operator=(TSharedRef<U>&& InValue) { return Helper::MoveSharedReference(*this, MoveTemp(InValue)); }
|
||||
|
||||
/** Compares the pointer values of two TSharedRef. */
|
||||
NODISCARD friend FORCEINLINE constexpr bool operator==(const TSharedRef& LHS, const TSharedRef& RHS) { return LHS.Get() == RHS.Get(); }
|
||||
template <typename U> requires (CEqualityComparable<T*, TRemoveExtent<U>*>)
|
||||
NODISCARD friend FORCEINLINE constexpr bool operator==(const TSharedRef& LHS, const TSharedRef<U>& RHS) { return LHS.Get() == RHS.Get(); }
|
||||
|
||||
/** Compares the pointer values of two TSharedRef. */
|
||||
NODISCARD friend FORCEINLINE constexpr strong_ordering operator<=>(const TSharedRef& LHS, const TSharedRef& RHS) { return LHS.Get() <=> RHS.Get(); }
|
||||
template <typename U> requires (CThreeWayComparable<T*, TRemoveExtent<U>*>)
|
||||
NODISCARD friend FORCEINLINE constexpr strong_ordering operator<=>(const TSharedRef& LHS, const TSharedRef<U>& RHS) { return LHS.Get() <=> RHS.Get(); }
|
||||
|
||||
/** Compares the pointer values with a raw pointer. */
|
||||
template <typename U = T*> requires (CNullPointer<U> || (CPointer<U> && CConvertibleTo<TRemovePointer<U>(*)[], T(*)[]>))
|
||||
NODISCARD FORCEINLINE constexpr bool operator==(U InPtr) const& { return Get() == InPtr; }
|
||||
/** Compares the pointer values with nullptr. */
|
||||
NODISCARD FORCEINLINE constexpr bool operator==(nullptr_t) const& { return Get() == nullptr; }
|
||||
|
||||
/** Compares the pointer values with a raw pointer. */
|
||||
template <typename U = T*> requires (CNullPointer<U> || (CPointer<U> && CConvertibleTo<TRemovePointer<U>(*)[], T(*)[]>))
|
||||
NODISCARD FORCEINLINE constexpr strong_ordering operator<=>(U InPtr) const& { return Get() <=> InPtr; }
|
||||
/** Compares the pointer values with nullptr. */
|
||||
NODISCARD FORCEINLINE constexpr strong_ordering operator<=>(nullptr_t) const& { return Get() <=> static_cast<T*>(nullptr); }
|
||||
|
||||
/** TSharedRef cannot be initialized by nullptr. */
|
||||
void Reset(nullptr_t) = delete;
|
||||
@ -1094,16 +1096,18 @@ public:
|
||||
FORCEINLINE TSharedPtr& operator=(nullptr_t) { Reset(); return *this; }
|
||||
|
||||
/** Compares the pointer values of two TSharedPtr. */
|
||||
NODISCARD friend FORCEINLINE constexpr bool operator==(const TSharedPtr& LHS, const TSharedPtr& RHS) { return LHS.Get() == RHS.Get(); }
|
||||
template <typename U> requires (CEqualityComparable<T*, TRemoveExtent<U>*>)
|
||||
NODISCARD friend FORCEINLINE constexpr bool operator==(const TSharedPtr& LHS, const TSharedPtr<U>& RHS) { return LHS.Get() == RHS.Get(); }
|
||||
|
||||
/** Compares the pointer values of two TSharedPtr. */
|
||||
NODISCARD friend FORCEINLINE constexpr strong_ordering operator<=>(const TSharedPtr& LHS, const TSharedPtr& RHS) { return LHS.Get() <=> RHS.Get(); }
|
||||
template <typename U> requires (CThreeWayComparable<T*, TRemoveExtent<U>*>)
|
||||
NODISCARD friend FORCEINLINE constexpr strong_ordering operator<=>(const TSharedPtr& LHS, const TSharedPtr<U>& RHS) { return LHS.Get() <=> RHS.Get(); }
|
||||
|
||||
/** Compares the pointer values with a raw pointer. */
|
||||
NODISCARD FORCEINLINE constexpr bool operator==(T* InPtr) const& { return Get() == InPtr; }
|
||||
/** Compares the pointer values with nullptr. */
|
||||
NODISCARD FORCEINLINE constexpr bool operator==(nullptr_t) const& { return Get() == nullptr; }
|
||||
|
||||
/** Compares the pointer values with a raw pointer. */
|
||||
NODISCARD FORCEINLINE constexpr strong_ordering operator<=>(T* InPtr) const& { return Get() <=> InPtr; }
|
||||
/** Compares the pointer values with nullptr. */
|
||||
NODISCARD FORCEINLINE constexpr strong_ordering operator<=>(nullptr_t) const& { return Get() <=> static_cast<T*>(nullptr); }
|
||||
|
||||
/** Converts a shared pointer to a shared reference. The pointer MUST be valid or an assertion will trigger. */
|
||||
FORCEINLINE TSharedRef<T> ToSharedRef() const&
|
||||
@ -1360,18 +1364,18 @@ public:
|
||||
FORCEINLINE TSharedPtr& operator=(nullptr_t) { Reset(); return *this; }
|
||||
|
||||
/** Compares the pointer values of two TSharedPtr. */
|
||||
NODISCARD friend FORCEINLINE constexpr bool operator==(const TSharedPtr& LHS, const TSharedPtr& RHS) { return LHS.Get() == RHS.Get(); }
|
||||
template <typename U> requires (CEqualityComparable<T*, TRemoveExtent<U>*>)
|
||||
NODISCARD friend FORCEINLINE constexpr bool operator==(const TSharedPtr& LHS, const TSharedPtr<U>& RHS) { return LHS.Get() == RHS.Get(); }
|
||||
|
||||
/** Compares the pointer values of two TSharedPtr. */
|
||||
NODISCARD friend FORCEINLINE constexpr strong_ordering operator<=>(const TSharedPtr& LHS, const TSharedPtr& RHS) { return LHS.Get() <=> RHS.Get(); }
|
||||
template <typename U> requires (CThreeWayComparable<T*, TRemoveExtent<U>*>)
|
||||
NODISCARD friend FORCEINLINE constexpr strong_ordering operator<=>(const TSharedPtr& LHS, const TSharedPtr<U>& RHS) { return LHS.Get() <=> RHS.Get(); }
|
||||
|
||||
/** Compares the pointer values with a raw pointer. */
|
||||
template <typename U = T*> requires (CNullPointer<U> || (CPointer<U> && CConvertibleTo<TRemovePointer<U>(*)[], T(*)[]>))
|
||||
NODISCARD FORCEINLINE constexpr bool operator==(U InPtr) const& { return Get() == InPtr; }
|
||||
/** Compares the pointer values with nullptr. */
|
||||
NODISCARD FORCEINLINE constexpr bool operator==(nullptr_t) const& { return Get() == nullptr; }
|
||||
|
||||
/** Compares the pointer values with a raw pointer. */
|
||||
template <typename U = T*> requires (CNullPointer<U> || (CPointer<U> && CConvertibleTo<TRemovePointer<U>(*)[], T(*)[]>))
|
||||
NODISCARD FORCEINLINE constexpr strong_ordering operator<=>(U InPtr) const& { return Get() <=> InPtr; }
|
||||
/** Compares the pointer values with nullptr. */
|
||||
NODISCARD FORCEINLINE constexpr strong_ordering operator<=>(nullptr_t) const& { return Get() <=> static_cast<T*>(nullptr); }
|
||||
|
||||
/** Converts a shared pointer to a shared reference. The pointer MUST be valid or an assertion will trigger. */
|
||||
FORCEINLINE TSharedRef<T[]> ToSharedRef() const&
|
||||
|
@ -177,16 +177,18 @@ public:
|
||||
FORCEINLINE constexpr ~TUniqueRef() { Invoke(GetDeleter(), Get()); }
|
||||
|
||||
/** Compares the pointer values of two TUniqueRef. */
|
||||
NODISCARD friend FORCEINLINE constexpr bool operator==(const TUniqueRef& LHS, const TUniqueRef& RHS) { return LHS.Get() == RHS.Get(); }
|
||||
template <typename U, typename InE> requires (CEqualityComparable<T*, TRemoveExtent<U>*>)
|
||||
NODISCARD friend FORCEINLINE constexpr bool operator==(const TUniqueRef& LHS, const TUniqueRef<U, InE>& RHS) { return LHS.Get() == RHS.Get(); }
|
||||
|
||||
/** Compares the pointer values of two TUniqueRef. */
|
||||
NODISCARD friend FORCEINLINE constexpr strong_ordering operator<=>(const TUniqueRef& LHS, const TUniqueRef& RHS) { return LHS.Get() <=> RHS.Get(); }
|
||||
template <typename U, typename InE> requires (CThreeWayComparable<T*, TRemoveExtent<U>*>)
|
||||
NODISCARD friend FORCEINLINE constexpr strong_ordering operator<=>(const TUniqueRef& LHS, const TUniqueRef<U, InE>& RHS) { return LHS.Get() <=> RHS.Get(); }
|
||||
|
||||
/** Compares the pointer values with a raw pointer. */
|
||||
NODISCARD FORCEINLINE constexpr bool operator==(T* InPtr) const& { return Get() == InPtr; }
|
||||
/** Compares the pointer values with nullptr. */
|
||||
NODISCARD FORCEINLINE constexpr bool operator==(nullptr_t) const& { return Get() == nullptr; }
|
||||
|
||||
/** Compares the pointer values with a raw pointer. */
|
||||
NODISCARD FORCEINLINE constexpr strong_ordering operator<=>(T* InPtr) const& { return Get() <=> InPtr; }
|
||||
/** Compares the pointer values with nullptr. */
|
||||
NODISCARD FORCEINLINE constexpr strong_ordering operator<=>(nullptr_t) const& { return Get() <=> static_cast<T*>(nullptr); }
|
||||
|
||||
/** TUniqueRef cannot be reset to nullptr. */
|
||||
void Reset(nullptr_t) = delete;
|
||||
@ -297,18 +299,18 @@ public:
|
||||
FORCEINLINE constexpr ~TUniqueRef() { Invoke(GetDeleter(), Get()); }
|
||||
|
||||
/** Compares the pointer values of two TUniqueRef. */
|
||||
NODISCARD friend FORCEINLINE constexpr bool operator==(const TUniqueRef& LHS, const TUniqueRef& RHS) { return LHS.Get() == RHS.Get(); }
|
||||
template <typename U, typename InE> requires (CEqualityComparable<T*, TRemoveExtent<U>*>)
|
||||
NODISCARD friend FORCEINLINE constexpr bool operator==(const TUniqueRef& LHS, const TUniqueRef<U, InE>& RHS) { return LHS.Get() == RHS.Get(); }
|
||||
|
||||
/** Compares the pointer values of two TUniqueRef. */
|
||||
NODISCARD friend FORCEINLINE constexpr strong_ordering operator<=>(const TUniqueRef& LHS, const TUniqueRef& RHS) { return LHS.Get() <=> RHS.Get(); }
|
||||
template <typename U, typename InE> requires (CThreeWayComparable<T*, TRemoveExtent<U>*>)
|
||||
NODISCARD friend FORCEINLINE constexpr strong_ordering operator<=>(const TUniqueRef& LHS, const TUniqueRef<U, InE>& RHS) { return LHS.Get() <=> RHS.Get(); }
|
||||
|
||||
/** Compares the pointer values with a raw pointer. */
|
||||
template <typename U = T> requires (CNullPointer<U> || (CPointer<U> && CConvertibleTo<TRemovePointer<U>(*)[], T(*)[]>))
|
||||
NODISCARD FORCEINLINE constexpr bool operator==(U InPtr) const& { return Get() == InPtr; }
|
||||
/** Compares the pointer values with nullptr. */
|
||||
NODISCARD FORCEINLINE constexpr bool operator==(nullptr_t) const& { return Get() == nullptr; }
|
||||
|
||||
/** Compares the pointer values with a raw pointer. */
|
||||
template <typename U = T> requires (CNullPointer<U> || (CPointer<U> && CConvertibleTo<TRemovePointer<U>(*)[], T(*)[]>))
|
||||
NODISCARD FORCEINLINE constexpr strong_ordering operator<=>(U InPtr) const& { return Get() <=> InPtr; }
|
||||
/** Compares the pointer values with nullptr. */
|
||||
NODISCARD FORCEINLINE constexpr strong_ordering operator<=>(nullptr_t) const& { return Get() <=> static_cast<T*>(nullptr); }
|
||||
|
||||
/** TUniqueRef cannot be reset to nullptr. */
|
||||
void Reset(nullptr_t) = delete;
|
||||
@ -440,16 +442,18 @@ public:
|
||||
FORCEINLINE constexpr TUniquePtr& operator=(nullptr_t) { Reset(); return *this; }
|
||||
|
||||
/** Compares the pointer values of two TUniquePtr. */
|
||||
NODISCARD friend FORCEINLINE constexpr bool operator==(const TUniquePtr& LHS, const TUniquePtr& RHS) { return LHS.Get() == RHS.Get(); }
|
||||
template <typename U, typename InE> requires (CEqualityComparable<T*, TRemoveExtent<U>*>)
|
||||
NODISCARD friend FORCEINLINE constexpr bool operator==(const TUniquePtr& LHS, const TUniquePtr<U, InE>& RHS) { return LHS.Get() == RHS.Get(); }
|
||||
|
||||
/** Compares the pointer values of two TUniquePtr. */
|
||||
NODISCARD friend FORCEINLINE constexpr strong_ordering operator<=>(const TUniquePtr& LHS, const TUniquePtr& RHS) { return LHS.Get() <=> RHS.Get(); }
|
||||
template <typename U, typename InE> requires (CThreeWayComparable<T*, TRemoveExtent<U>*>)
|
||||
NODISCARD friend FORCEINLINE constexpr strong_ordering operator<=>(const TUniquePtr& LHS, const TUniquePtr<U, InE>& RHS) { return LHS.Get() <=> RHS.Get(); }
|
||||
|
||||
/** Compares the pointer values with a raw pointer. */
|
||||
NODISCARD FORCEINLINE constexpr bool operator==(T* InPtr) const& { return Get() == InPtr; }
|
||||
/** Compares the pointer values with nullptr. */
|
||||
NODISCARD FORCEINLINE constexpr bool operator==(nullptr_t) const& { return Get() == nullptr; }
|
||||
|
||||
/** Compares the pointer values with a raw pointer. */
|
||||
NODISCARD FORCEINLINE constexpr strong_ordering operator<=>(T* InPtr) const& { return Get() <=> InPtr; }
|
||||
/** Compares the pointer values with nullptr. */
|
||||
NODISCARD FORCEINLINE constexpr strong_ordering operator<=>(nullptr_t) const& { return Get() <=> static_cast<T*>(nullptr); }
|
||||
|
||||
/** Returns a pointer to the managed object and releases the ownership. */
|
||||
NODISCARD FORCEINLINE constexpr T* Release() { return Exchange(Storage.GetPointer(), nullptr); }
|
||||
@ -577,18 +581,18 @@ public:
|
||||
FORCEINLINE constexpr TUniquePtr& operator=(nullptr_t) { Reset(); return *this; }
|
||||
|
||||
/** Compares the pointer values of two TUniquePtr. */
|
||||
NODISCARD friend FORCEINLINE constexpr bool operator==(const TUniquePtr& LHS, const TUniquePtr& RHS) { return LHS.Get() == RHS.Get(); }
|
||||
template <typename U, typename InE> requires (CEqualityComparable<T*, TRemoveExtent<U>*>)
|
||||
NODISCARD friend FORCEINLINE constexpr bool operator==(const TUniquePtr& LHS, const TUniquePtr<U, InE>& RHS) { return LHS.Get() == RHS.Get(); }
|
||||
|
||||
/** Compares the pointer values of two TUniquePtr. */
|
||||
NODISCARD friend FORCEINLINE constexpr strong_ordering operator<=>(const TUniquePtr& LHS, const TUniquePtr& RHS) { return LHS.Get() <=> RHS.Get(); }
|
||||
template <typename U, typename InE> requires (CThreeWayComparable<T*, TRemoveExtent<U>*>)
|
||||
NODISCARD friend FORCEINLINE constexpr strong_ordering operator<=>(const TUniquePtr& LHS, const TUniquePtr<U, InE>& RHS) { return LHS.Get() <=> RHS.Get(); }
|
||||
|
||||
/** Compares the pointer values with a raw pointer. */
|
||||
template <typename U = T*> requires (CNullPointer<U> || (CPointer<U> && CConvertibleTo<TRemovePointer<U>(*)[], T(*)[]>))
|
||||
NODISCARD FORCEINLINE constexpr bool operator==(U InPtr) const& { return Get() == InPtr; }
|
||||
/** Compares the pointer values with nullptr. */
|
||||
NODISCARD FORCEINLINE constexpr bool operator==(nullptr_t) const& { return Get() == nullptr; }
|
||||
|
||||
/** Compares the pointer values with a raw pointer. */
|
||||
template <typename U = T*> requires (CNullPointer<U> || (CPointer<U> && CConvertibleTo<TRemovePointer<U>(*)[], T(*)[]>))
|
||||
NODISCARD FORCEINLINE constexpr strong_ordering operator<=>(U InPtr) const& { return Get() <=> InPtr; }
|
||||
/** Compares the pointer values with nullptr. */
|
||||
NODISCARD FORCEINLINE constexpr strong_ordering operator<=>(nullptr_t) const& { return Get() <=> static_cast<T*>(nullptr); }
|
||||
|
||||
/** Returns a pointer to the managed array and releases the ownership. */
|
||||
NODISCARD FORCEINLINE constexpr T* Release() { return Exchange(Storage.GetPointer(), nullptr); }
|
||||
|
Loading…
Reference in New Issue
Block a user