[ox/std] Fix Vector copy assignment to allocate as char*
This commit is contained in:
parent
16a09d6814
commit
0b218f57c2
2
deps/ox/src/ox/std/vector.hpp
vendored
2
deps/ox/src/ox/std/vector.hpp
vendored
@ -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];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user