aboutsummaryrefslogtreecommitdiff
path: root/common/array.h
diff options
context:
space:
mode:
authorMatthew Hoops2011-07-20 09:27:39 -0400
committerMatthew Hoops2011-07-20 09:27:39 -0400
commitad293b249e74dd1cfbdbd721d02145efbdaf9eca (patch)
treee568d96f6d7f64c5e58b4c7cd1c4fda7e649bfc7 /common/array.h
parentd7411acc2b1c7702280dbff1c3e1bafee528184b (diff)
parente25e85fbb047fef895ede97c3c2c73451631052c (diff)
downloadscummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.tar.gz
scummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.tar.bz2
scummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.zip
Merge remote branch 'upstream/master' into pegasus
Diffstat (limited to 'common/array.h')
-rw-r--r--common/array.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/array.h b/common/array.h
index 7ab4a1b042..e5434091fb 100644
--- a/common/array.h
+++ b/common/array.h
@@ -252,6 +252,13 @@ public:
_size = newSize;
}
+ void assign(const_iterator first, const_iterator last) {
+ resize(distance(first, last)); // FIXME: ineffective?
+ T *dst = _storage;
+ while (first != last)
+ *dst++ = *first++;
+ }
+
protected:
static uint roundUpCapacity(uint capacity) {
// Round up capacity to the next power of 2;