From 74f3263ceae86ae62813d472b4ce745914321ef1 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Sun, 26 Apr 2020 13:57:47 -0700 Subject: [PATCH] AK: Add SinglyLinkedListIterator::is_begin() It's useful to be able to tell if we are at the beginning of the list when using the list as a queue. --- AK/SinglyLinkedList.h | 1 + 1 file changed, 1 insertion(+) diff --git a/AK/SinglyLinkedList.h b/AK/SinglyLinkedList.h index 7238b4c76a..b12c0d0377 100644 --- a/AK/SinglyLinkedList.h +++ b/AK/SinglyLinkedList.h @@ -46,6 +46,7 @@ public: ElementType& operator*() { return m_node->value; } ElementType* operator->() { return &m_node->value; } bool is_end() const { return !m_node; } + bool is_begin() const { return !m_prev; } private: friend ListType;