[ox/std] Fix Vector copy assignment to allocate as char*

This commit is contained in:
Gary Talent 2019-07-15 18:10:00 -05:00
parent 16a09d6814
commit 0b218f57c2

View File

@ -127,7 +127,7 @@ Vector<T> &Vector<T>::operator=(Vector<T> &other) noexcept {
this->~Vector<T>(); this->~Vector<T>();
m_size = other.m_size; m_size = other.m_size;
m_cap = other.m_cap; m_cap = other.m_cap;
m_items = new T[m_cap]; m_items = reinterpret_cast<T*>(new char[m_cap * sizeof(T)]);
for (std::size_t i = 0; i < m_size; i++) { for (std::size_t i = 0; i < m_size; i++) {
m_items[i] = other.m_items[i]; m_items[i] = other.m_items[i];
} }