Website Summary Files Commits Branches @commit @diff @stats
path: root / src / List
diff options
context:
space:
mode:
1 files changed, 5 insertions, 3 deletions
-rw-r--r--src/List/List.hpp8
diff --git a/src/List/List.hpp b/src/List/List.hpp
index 1e75c89..7088f2e 100644
--- a/src/List/List.hpp
+++ b/src/List/List.hpp
@@ -70,9 +70,11 @@ void List<T>::copyFrom(const List& other) {
template <class T>
List<T>::List(const T* elements, unsigned elementsCount) {
- count = length = 0;
- for (unsigned i = 0; i < elementsCount; i++)
- add(elements[i]);
+ length = 8;
+ count = elementsCount;
+ this->elements = new T[length];
+ for (unsigned i = 0; i < count; i++)
+ this->elements[i] = elements[i];
}
template <class T>