mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:07:34 +00:00
AK: Add Queue::head()
This returns a const T& for the first element in the queue, without dequeuing it.
This commit is contained in:
parent
c1d3ac7108
commit
78a744da77
1 changed files with 6 additions and 0 deletions
|
@ -40,6 +40,12 @@ public:
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const T& head() const
|
||||||
|
{
|
||||||
|
ASSERT(!is_empty());
|
||||||
|
return (*m_segments.first())[m_index_into_first];
|
||||||
|
}
|
||||||
|
|
||||||
void clear()
|
void clear()
|
||||||
{
|
{
|
||||||
m_segments.clear();
|
m_segments.clear();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue