[ox/std] Make UAnyPtr uncopyable
This commit is contained in:
parent
672b92b363
commit
87e2fdefcf
8
deps/ox/src/ox/std/anyptr.hpp
vendored
8
deps/ox/src/ox/std/anyptr.hpp
vendored
@ -64,7 +64,7 @@ class AnyPtrT {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr AnyPtrT(AnyPtrT const&other) noexcept {
|
constexpr AnyPtrT(AnyPtrT const&other) noexcept requires(!unique) {
|
||||||
if (other) {
|
if (other) {
|
||||||
m_wrapPtr = other.m_wrapPtr->copyTo(m_wrapData);
|
m_wrapPtr = other.m_wrapPtr->copyTo(m_wrapData);
|
||||||
}
|
}
|
||||||
@ -104,11 +104,9 @@ class AnyPtrT {
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr AnyPtrT &operator=(AnyPtrT const&ptr) noexcept {
|
constexpr AnyPtrT &operator=(AnyPtrT const&ptr) noexcept requires(!unique) {
|
||||||
if (this != &ptr) {
|
if (this != &ptr) {
|
||||||
if constexpr(unique) {
|
if (std::is_constant_evaluated()) {
|
||||||
free();
|
|
||||||
} else if (std::is_constant_evaluated()) {
|
|
||||||
ox::safeDelete(m_wrapPtr);
|
ox::safeDelete(m_wrapPtr);
|
||||||
}
|
}
|
||||||
if (ptr) {
|
if (ptr) {
|
||||||
|
Loading…
Reference in New Issue
Block a user