aboutsummaryrefslogtreecommitdiff
path: root/common/array.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/array.h')
-rw-r--r--common/array.h9
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)