aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMax Horn2009-10-19 17:46:50 +0000
committerMax Horn2009-10-19 17:46:50 +0000
commit4d43c8a121d40a1e66640e0d137a7808dca4b0f1 (patch)
treebf0c8edd0b843cef63613c7109d9b5881bd05cbe /common
parent2824e302baa6f69a0b40c4679e8b5bde30f8202f (diff)
downloadscummvm-rg350-4d43c8a121d40a1e66640e0d137a7808dca4b0f1.tar.gz
scummvm-rg350-4d43c8a121d40a1e66640e0d137a7808dca4b0f1.tar.bz2
scummvm-rg350-4d43c8a121d40a1e66640e0d137a7808dca4b0f1.zip
Added operator== and != to Common::Array
svn-id: r45247
Diffstat (limited to 'common')
-rw-r--r--common/array.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/common/array.h b/common/array.h
index 0b5a65e9bd..4cc5369f9f 100644
--- a/common/array.h
+++ b/common/array.h
@@ -199,6 +199,21 @@ public:
return (_size == 0);
}
+ bool operator==(const Array<T> &other) const {
+ if (this == &other)
+ return true;
+ if (_size != other._size)
+ return false;
+ for (uint i = 0; i < _size; ++i) {
+ if (_storage[i] != other._storage[i])
+ return false;
+ }
+ return true;
+ }
+ bool operator!=(const Array<T> &other) const {
+ return !(*this == other);
+ }
+
iterator begin() {
return _storage;