1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:17:36 +00:00

Add Vector::remove().

This commit is contained in:
Andreas Kling 2018-10-13 01:17:36 +02:00
parent 750b27cb07
commit 7777c8844b
2 changed files with 47 additions and 2 deletions

View file

@ -127,5 +127,33 @@ int main(int, char**)
problem.append("test");
}
{
auto printInts = [] (const Vector<int>& v) {
printf("Vector {\n size: %u\n capacity: %u\n elements: ", v.size(), v.capacity());
for (auto i : v)
printf("%d ", i);
printf("\n}\n");
};
Vector<int> v;
v.append(0);
v.append(1);
v.append(2);
v.append(3);
printInts(v);
v.remove(1);
printInts(v);
v.remove(0);
printInts(v);
v.remove(0);
printInts(v);
v.remove(0);
printInts(v);
}
return 0;
}