diff options
Diffstat (limited to 'common/array.h')
-rw-r--r-- | common/array.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/common/array.h b/common/array.h index 6fde309ac4..497e44ba70 100644 --- a/common/array.h +++ b/common/array.h @@ -145,6 +145,15 @@ public: return _data + _size; } + bool contains(const T &key) const { + for (const_iterator i = begin(); i != end(); ++i) { + if (*i == key) + return true; + } + return false; + } + + protected: void ensureCapacity(int new_len) { if (new_len <= _capacity) |