AK: Add VectorIterator::index()

A simple helper function that extracts the index of an iterator.
Note that the index is not valid if the iterator is end().
This commit is contained in:
Andreas Kling 2019-08-04 20:17:55 +02:00
parent 2a89bb2ac4
commit a846ee76ea
Notes: sideshowbarker 2024-07-19 12:53:35 +09:00

View File

@ -50,6 +50,7 @@ public:
int operator-(const VectorIterator& other) { return m_index - other.m_index; }
bool is_end() const { return m_index == m_vector.size(); }
int index() const { return m_index; }
private:
friend VectorType;