1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Expanded const aggregate compatibility

This commit is contained in:
Brian Fiete 2021-01-18 14:09:16 -08:00
parent 13b943855e
commit f665388e91
17 changed files with 452 additions and 134 deletions

View file

@ -485,6 +485,28 @@ public:
this->mSize--;
}
void RemoveAll(const std::function<bool(const T& val)>& func)
{
int outIdx = 0;
for (int i = 0; i < this->mSize; i++)
{
if (func(this->mVals[i]))
{
this->mVals[i].~T();
}
else
{
if (i != outIdx)
{
new (&this->mVals[outIdx]) T(this->mVals[i]);
}
outIdx++;
}
}
this->mSize = outIdx;
}
void RemoveRange(intptr idx, intptr length)
{
BF_ASSERT(