diff options
-rw-r--r-- | common/list.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/common/list.h b/common/list.h index 4b3f5a20c2..7d7ccb0283 100644 --- a/common/list.h +++ b/common/list.h @@ -34,6 +34,10 @@ protected: T *_data; public: + typedef T *Iterator; + typedef const T *ConstIterator; + +public: List<T>() : _capacity(0), _size(0), _data(0) {} List<T>(const List<T>& list) : _capacity(0), _size(0), _data(0) { _size = list._size; @@ -108,6 +112,23 @@ public: return (_size == 0); } + + Iterator begin() { + return _data; + } + + Iterator end() { + return _data + _size; + } + + ConstIterator begin() const { + return _data; + } + + ConstIterator end() const { + return _data + _size; + } + protected: void ensureCapacity(int new_len) { if (new_len <= _capacity) |