mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-21 18:15:58 +00:00
Add Vector::take_first().
This commit is contained in:
parent
973ff14180
commit
11331e9639
|
@ -146,6 +146,14 @@ public:
|
|||
return value;
|
||||
}
|
||||
|
||||
T take_first()
|
||||
{
|
||||
ASSERT(!is_empty());
|
||||
T value = move(first());
|
||||
remove(0);
|
||||
return value;
|
||||
}
|
||||
|
||||
void remove(size_t index)
|
||||
{
|
||||
m_impl->remove(index);
|
||||
|
|
Loading…
Reference in a new issue