From f87dec1cbf55f74146a59b83b99ad6c703810699 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 15 Mar 2019 12:13:51 +0100 Subject: [PATCH] AK: Add CircularQueue::at(). --- AK/CircularQueue.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AK/CircularQueue.h b/AK/CircularQueue.h index 0dc39afdec1..7ffc111bd35 100644 --- a/AK/CircularQueue.h +++ b/AK/CircularQueue.h @@ -46,6 +46,8 @@ public: return value; } + const T& at(int index) const { return m_elements[(m_head + index) % Capacity]; } + class ConstIterator { public: bool operator!=(const ConstIterator& other) { return m_index != other.m_index; }