Website Summary Files Commits Branches @commit @diff @stats
path: root / src
diff options
context:
space:
mode:
Commit6cdf1b7017c6988213dd881ca1f42b22d75bbf3b (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-04-28 19:15:41 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-04-28 19:15:41 +0300
Filescfb7dd5fe3b35dbffceb06d62f3d01559205b23d /src
FMI-OOP-P1_TicketSystem-6cdf1b7017c6988213dd881ca1f42b22d75bbf3b.tar
FMI-OOP-P1_TicketSystem-6cdf1b7017c6988213dd881ca1f42b22d75bbf3b.tar.gz
FMI-OOP-P1_TicketSystem-6cdf1b7017c6988213dd881ca1f42b22d75bbf3b.zip
Parent9f5eb77f6a8cba01158c37dc17e7e53574d87127 (diff)
Autocommit at 28.04.2022 @ 19:15
2 files changed, 3 insertions, 1 deletions
-rw-r--r--src/List/List.cpp3
-rw-r--r--src/List/List.h1
diff --git a/src/List/List.cpp b/src/List/List.cpp
index 1312e61..66d66df 100644
--- a/src/List/List.cpp
+++ b/src/List/List.cpp
@@ -90,7 +90,8 @@ List<T>::List(List&& other) {
template <class T>
List<T>& List<T>::operator=(List&& other) {
- if (this != other) {
+ if (this != &other) {
+ free();
length = other.length;
count = other.count;
elements = other.elements;
diff --git a/src/List/List.h b/src/List/List.h
index c6f074d..0f256e5 100644
--- a/src/List/List.h
+++ b/src/List/List.h
@@ -10,6 +10,7 @@ class List {
void resize();
void free();
void copyFrom(const List& other);
+
public:
void add(const T& element);
bool removeAt(unsigned index);