X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2FRandomAccessList.h;h=2565d62513158ecc57e0f306ef471c9b477ab264;hb=8d640dc77608bedddb5b00982c23665584f52d21;hp=f4cf29ce5cea94e79c47ac27d84f2691b089ab60;hpb=0821902b99740fccb4368fe7960b9f446aa544b3;p=lyx.git diff --git a/src/support/RandomAccessList.h b/src/support/RandomAccessList.h index f4cf29ce5c..2565d62513 100644 --- a/src/support/RandomAccessList.h +++ b/src/support/RandomAccessList.h @@ -13,7 +13,6 @@ #ifndef RANDOM_ACESS_LIST_H #define RANDOM_ACESS_LIST_H -#include #include #include @@ -274,6 +273,32 @@ public: iterCont_.clear(); } + size_t position(iterator it) const + { + size_t const s = iterCont_.size(); + for (size_t i = 0; it != s; ++i) { + if (iterCont_[i] == it) + return i; + } + return s; + } + + size_t position(const_iterator it) const + { + size_t const s = iterCont_.size(); + for (size_t i = 0; i != s; ++i) { + if (iterCont_[i] == it) + return i; + } + return s; + } + + + const_iterator constIterator(size_t i) const + { + return iterCont_[i]; + } + private: void recreateVector() {