[ox/std] Make UAnyPtr uncopyable

This commit is contained in:
Gary Talent 2025-01-20 20:42:00 -06:00
parent 672b92b363
commit 87e2fdefcf

View File

@ -64,7 +64,7 @@ class AnyPtrT {
}
}
constexpr AnyPtrT(AnyPtrT const&other) noexcept {
constexpr AnyPtrT(AnyPtrT const&other) noexcept requires(!unique) {
if (other) {
m_wrapPtr = other.m_wrapPtr->copyTo(m_wrapData);
}
@ -104,11 +104,9 @@ class AnyPtrT {
return *this;
}
constexpr AnyPtrT &operator=(AnyPtrT const&ptr) noexcept {
constexpr AnyPtrT &operator=(AnyPtrT const&ptr) noexcept requires(!unique) {
if (this != &ptr) {
if constexpr(unique) {
free();
} else if (std::is_constant_evaluated()) {
if (std::is_constant_evaluated()) {
ox::safeDelete(m_wrapPtr);
}
if (ptr) {