1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:17:35 +00:00

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

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;