diff options
author | Vladimir | 2011-06-07 00:10:39 +0400 |
---|---|---|
committer | Alyssa Milburn | 2011-06-15 17:29:52 +0200 |
commit | e3178397ce9dd1e5e52e7a6831f3a19670005076 (patch) | |
tree | dc626fa4380d2395f3c5e7b2af7d7174388b97df /common | |
parent | 10c84a81fe3e04d9b923c023c46e89ca9eeb151a (diff) | |
download | scummvm-rg350-e3178397ce9dd1e5e52e7a6831f3a19670005076.tar.gz scummvm-rg350-e3178397ce9dd1e5e52e7a6831f3a19670005076.tar.bz2 scummvm-rg350-e3178397ce9dd1e5e52e7a6831f3a19670005076.zip |
COMMON: added assign(T*, T*)
Diffstat (limited to 'common')
-rw-r--r-- | common/array.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/common/array.h b/common/array.h index 7ab4a1b042..b3d3e01727 100644 --- a/common/array.h +++ b/common/array.h @@ -252,6 +252,13 @@ public: _size = newSize; } + void assign(const T *srcBegin, const T *srcEnd) { + reserve(distance(srcBegin, srcEnd)); + T *dst = _storage; + while(srcBegin != srcEnd) + *dst++ = *srcBegin++; + } + protected: static uint roundUpCapacity(uint capacity) { // Round up capacity to the next power of 2; |