[ox/std] Remove copy constructor and operator from MallocaPtr

This commit is contained in:
Gary Talent 2018-05-03 23:26:26 -05:00
parent 78a819b360
commit 1c16ef2601

View File

@ -54,6 +54,8 @@ class MallocaPtr {
public:
inline MallocaPtr() noexcept = default;
inline MallocaPtr(MallocaPtr &other) = delete;
inline MallocaPtr(MallocaPtr &&other) noexcept {
m_size = other.m_size;
m_val = other.m_val;
@ -81,6 +83,15 @@ class MallocaPtr {
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 {
return reinterpret_cast<T*>(m_val);
}