(svn r20729) -Fix [FS#4107]: assert when overbuilding object

This commit is contained in:
yexo
2010-09-03 21:50:51 +00:00
parent bd379e283f
commit a45b598bfc
5 changed files with 25 additions and 0 deletions

View File

@@ -13,6 +13,7 @@
#define SMALLVEC_TYPE_HPP
#include "alloc_func.hpp"
#include "mem_func.hpp"
#include "math_func.hpp"
/**
@@ -35,6 +36,12 @@ protected:
public:
SmallVector() : data(NULL), items(0), capacity(0) { }
template<uint X>
SmallVector(const SmallVector<T, X> &other) : data(NULL), items(0), capacity(0)
{
MemCpyT<T>(this->Append(other.Length()), other.Begin(), other.Length());
}
~SmallVector()
{
free(this->data);