mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-29 09:05:41 +00:00
FIFOQueue: Add PopRange
This commit is contained in:
parent
9ee8c0194e
commit
a23a353dbb
|
@ -121,6 +121,19 @@ public:
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PopRange(T* out_data, u32 count)
|
||||||
|
{
|
||||||
|
Assert(m_size >= count);
|
||||||
|
|
||||||
|
for (u32 i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
out_data[i] = std::move(m_ptr[m_head]);
|
||||||
|
m_ptr[m_head].~T();
|
||||||
|
m_head = (m_head + 1) % CAPACITY;
|
||||||
|
m_size--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
FIFOQueue() = default;
|
FIFOQueue() = default;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue