mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
Add Vector::take_first().
This commit is contained in:
parent
973ff14180
commit
11331e9639
Notes:
sideshowbarker
2024-07-19 16:02:53 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/11331e9639e
@ -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…
Reference in New Issue
Block a user