From bbd110ebcf4dcf2d13867ee70a5eb2cff32ea8b4 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 5 May 2022 14:43:49 +0300 Subject: Autocommit at 05.05.2022 @ 14:43 --- src/List/List.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/List') 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::copyFrom(const List& other) { template List::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 -- cgit v1.3.1-23-gd82d