Browse Source

AK: Add CircularQueue::at().

Andreas Kling 6 years ago
parent
commit
f87dec1cbf
1 changed files with 2 additions and 0 deletions
  1. 2 0
      AK/CircularQueue.h

+ 2 - 0
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; }