diff options
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; |