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:
parent
13b943855e
commit
f665388e91
17 changed files with 452 additions and 134 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue