From e3178397ce9dd1e5e52e7a6831f3a19670005076 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 7 Jun 2011 00:10:39 +0400 Subject: COMMON: added assign(T*, T*) --- common/array.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'common') 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; -- cgit v1.2.3