mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:47:46 +00:00
Add Vector::take_first().
This commit is contained in:
parent
973ff14180
commit
11331e9639
1 changed files with 8 additions and 0 deletions
|
@ -146,6 +146,14 @@ public:
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
T take_first()
|
||||||
|
{
|
||||||
|
ASSERT(!is_empty());
|
||||||
|
T value = move(first());
|
||||||
|
remove(0);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
void remove(size_t index)
|
void remove(size_t index)
|
||||||
{
|
{
|
||||||
m_impl->remove(index);
|
m_impl->remove(index);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue