[ox/std] Fix another inappropriate assign with constructor

This commit is contained in:
Gary Talent 2021-07-31 04:05:56 -05:00
parent 8480eeba0c
commit 90b2e7a43c

View File

@ -531,7 +531,7 @@ void Vector<T, SmallVectorSize>::insert(std::size_t pos, const T &val) {
expandCap(m_cap ? m_cap * 2 : 100);
}
for (auto i = m_size; i > pos; --i) {
m_items[i] = move(m_items[i - 1]);
new (&m_items[i]) T(move(m_items[i - 1]));
}
m_items[pos] = val;
++m_size;
@ -599,7 +599,7 @@ void Vector<T, SmallVectorSize>::expandCap(std::size_t cap) {
if (oldItems) { // move over old items
const auto itRange = cap > m_size ? m_size : cap;
for (std::size_t i = 0; i < itRange; i++) {
m_items[i] = move(oldItems[i]);
new (&m_items[i]) T(move(oldItems[i]));
}
this->clearItems(bit_cast<AllocAlias<T>*>(oldItems));
}