Merge pull request #47 from Jopie64/master

Fix grow size during Array<>::append
This commit is contained in:
vitaut 2014-06-16 07:48:05 -07:00
commit 7d8f3c261a

View File

@ -315,7 +315,7 @@ template <typename T, std::size_t SIZE>
void Array<T, SIZE>::append(const T *begin, const T *end) { void Array<T, SIZE>::append(const T *begin, const T *end) {
std::ptrdiff_t num_elements = end - begin; std::ptrdiff_t num_elements = end - begin;
if (size_ + num_elements > capacity_) if (size_ + num_elements > capacity_)
Grow(num_elements); Grow(size_ + num_elements);
std::copy(begin, end, CheckPtr(ptr_, capacity_) + size_); std::copy(begin, end, CheckPtr(ptr_, capacity_) + size_);
size_ += num_elements; size_ += num_elements;
} }