From 87e2fdefcfee7ae082d000d1544221d58a1c4cf5 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Mon, 20 Jan 2025 20:42:00 -0600 Subject: [PATCH] [ox/std] Make UAnyPtr uncopyable --- deps/ox/src/ox/std/anyptr.hpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/deps/ox/src/ox/std/anyptr.hpp b/deps/ox/src/ox/std/anyptr.hpp index 19f96bf8..36a6ac9b 100644 --- a/deps/ox/src/ox/std/anyptr.hpp +++ b/deps/ox/src/ox/std/anyptr.hpp @@ -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) {