CircularQueue: Move construct a T object instead of copy constructing it

This commit is contained in:
howar6hill 2020-02-26 11:17:03 +08:00 committed by Andreas Kling
parent 717cd5015e
commit a57f074187
Notes: sideshowbarker 2024-07-19 17:38:34 +09:00

View file

@ -64,7 +64,7 @@ public:
if (m_size == Capacity)
slot.~T();
new (&slot) T(value);
new (&slot) T(move(value));
if (m_size == Capacity)
m_head = (m_head + 1) % Capacity;
else