[*] PmrCppHeapWrapper fixes

This commit is contained in:
Reece Wilson 2024-09-10 04:46:13 +01:00
parent e62a99777f
commit ffb1cbb09b

View File

@ -237,12 +237,29 @@ namespace Aurora::Memory
#endif #endif
} }
template <class Z>
bool operator==(const Aurora::Memory::PmrCppHeapWrapper<Z> &rhs) noexcept
{
return this->GetHeapRaw() == rhs.GetHeapRaw();
}
template <class Z>
bool operator!=(const Aurora::Memory::PmrCppHeapWrapper<Z> &rhs) noexcept
{
return this->GetHeapRaw() == rhs.GetHeapRaw();
}
template <class Z> template <class Z>
bool operator==(const Aurora::Memory::CppHeapWrapper<Z> &rhs) noexcept bool operator==(const Aurora::Memory::CppHeapWrapper<Z> &rhs) noexcept
{ {
return this->GetHeapRaw() == rhs.GetHeapRaw(); return this->GetHeapRaw() == rhs.GetHeapRaw();
} }
template <class Z>
bool operator!=(const Aurora::Memory::CppHeapWrapper<Z> &rhs) noexcept
{
return this->GetHeapRaw() == rhs.GetHeapRaw();
}
private: private:
#if defined(AU_NO_COMPRESS_CPPHEAP_WRAPPER) #if defined(AU_NO_COMPRESS_CPPHEAP_WRAPPER)
mutable std::shared_ptr<void> spHeap; mutable std::shared_ptr<void> spHeap;
@ -251,6 +268,8 @@ namespace Aurora::Memory
mutable std::shared_ptr<Heap> spHeap; mutable std::shared_ptr<Heap> spHeap;
#endif #endif
template <typename Z>
friend struct PmrCppHeapWrapper;
friend struct detail::AccessorICantEven; friend struct detail::AccessorICantEven;
}; };
@ -562,7 +581,9 @@ namespace Aurora::Memory
#endif #endif
mutable CppHeapWrapper *pFuckCppRetardsFixYourWorthlessSpec {}; mutable CppHeapWrapper *pFuckCppRetardsFixYourWorthlessSpec {};
mutable CppHeapWrapper *pFuckCppRetardsFixYourWorthlessSpec2 {}; mutable CppHeapWrapper *pFuckCppRetardsFixYourWorthlessSpec2 {};
template <typename Z>
friend struct CppHeapWrapper;
friend struct detail::AccessorICantEven; friend struct detail::AccessorICantEven;
}; };
} }
@ -579,4 +600,17 @@ inline bool operator==(const Aurora::Memory::PmrCppHeapWrapper<T> &lhs,
const Aurora::Memory::PmrCppHeapWrapper<Z> &rhs) noexcept const Aurora::Memory::PmrCppHeapWrapper<Z> &rhs) noexcept
{ {
return lhs.GetHeapRaw() == rhs.GetHeapRaw(); return lhs.GetHeapRaw() == rhs.GetHeapRaw();
}
template <class T, class Z>
inline bool operator!=(const Aurora::Memory::CppHeapWrapper<T> &lhs,
const Aurora::Memory::CppHeapWrapper<Z> &rhs) noexcept
{
return lhs.GetHeapRaw() != rhs.GetHeapRaw();
}
template <class T, class Z>
inline bool operator!=(const Aurora::Memory::PmrCppHeapWrapper<T> &lhs,
const Aurora::Memory::PmrCppHeapWrapper<Z> &rhs) noexcept
{
return lhs.GetHeapRaw() != rhs.GetHeapRaw();
} }