SPU LLVM: Another fix for Game Collection's precompilation

This commit is contained in:
Eladash 2023-09-01 15:07:46 +03:00 committed by Elad Ashkenazi
parent 26b3970485
commit a9810ccb72
4 changed files with 66 additions and 33 deletions

View file

@ -270,6 +270,30 @@ public:
return {};
}
const T& operator[](usz index) const noexcept
{
lf_queue_iterator<T> result = begin();
while (--index != umax)
{
result++;
}
return *result;
}
T& operator[](usz index) noexcept
{
lf_queue_iterator<T> result = begin();
while (--index != umax)
{
result++;
}
return *result;
}
lf_queue_slice& pop_front()
{
delete std::exchange(m_head, std::exchange(m_head->m_link, nullptr));
@ -315,6 +339,23 @@ class lf_queue final
public:
constexpr lf_queue() = default;
lf_queue(lf_queue&& other) noexcept
{
m_head.release(other.m_head.exchange(0));
}
lf_queue& operator=(lf_queue&& other) noexcept
{
if (this == std::addressof(other))
{
return *this;
}
delete load(m_head);
m_head.release(other.m_head.exchange(0));
return *this;
}
~lf_queue()
{
delete load(m_head);