Add resize(size_t, const T &) function to vector class

This commit is contained in:
EnderIce2 2024-02-10 05:17:03 +02:00
parent eba6bc07c1
commit 3374eac741
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD

View File

@ -285,6 +285,14 @@ namespace std
this->VectorSize.store(Size); this->VectorSize.store(Size);
} }
void resize(size_t count, const T &value)
{
reserve(count);
for (size_t i = this->VectorSize.load(); i < count; i++)
this->VectorBuffer[i] = value;
this->VectorSize.store(count);
}
void clear() void clear()
{ {
this->VectorCapacity.store(0); this->VectorCapacity.store(0);