diff --git a/container/FixedArrayList.h b/container/FixedArrayList.h index 42b59177..e9e127cf 100644 --- a/container/FixedArrayList.h +++ b/container/FixedArrayList.h @@ -2,11 +2,13 @@ #define FIXEDARRAYLIST_H_ #include "ArrayList.h" +#include /** * \ingroup container */ -template +template class FixedArrayList: public ArrayList { + static_assert(MAX_SIZE <= (pow(2,sizeof(count_t)*8)-1), "count_t is not large enough to hold MAX_SIZE"); private: T data[MAX_SIZE]; public: @@ -18,11 +20,13 @@ public: ArrayList(data, MAX_SIZE) { memcpy(this->data, other.data, sizeof(this->data)); this->entries = data; + this->size = other.size; } FixedArrayList& operator=(FixedArrayList other) { memcpy(this->data, other.data, sizeof(this->data)); this->entries = data; + this->size = other.size; return *this; }