[ox/std] Remove copy constructor and operator from MallocaPtr
This commit is contained in:
parent
78a819b360
commit
1c16ef2601
11
deps/ox/src/ox/std/new.hpp
vendored
11
deps/ox/src/ox/std/new.hpp
vendored
@ -54,6 +54,8 @@ class MallocaPtr {
|
|||||||
public:
|
public:
|
||||||
inline MallocaPtr() noexcept = default;
|
inline MallocaPtr() noexcept = default;
|
||||||
|
|
||||||
|
inline MallocaPtr(MallocaPtr &other) = delete;
|
||||||
|
|
||||||
inline MallocaPtr(MallocaPtr &&other) noexcept {
|
inline MallocaPtr(MallocaPtr &&other) noexcept {
|
||||||
m_size = other.m_size;
|
m_size = other.m_size;
|
||||||
m_val = other.m_val;
|
m_val = other.m_val;
|
||||||
@ -81,6 +83,15 @@ class MallocaPtr {
|
|||||||
return reinterpret_cast<T*>(m_val);
|
return reinterpret_cast<T*>(m_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline const T &operator=(MallocaPtr &other) = delete;
|
||||||
|
|
||||||
|
inline const T &operator=(MallocaPtr &&other) noexcept {
|
||||||
|
m_size = other.m_size;
|
||||||
|
m_val = other.m_val;
|
||||||
|
other.m_size = 0;
|
||||||
|
other.m_val = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
inline const T *operator->() const noexcept {
|
inline const T *operator->() const noexcept {
|
||||||
return reinterpret_cast<T*>(m_val);
|
return reinterpret_cast<T*>(m_val);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user