Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Generic / List / List.hpp
diff options
context:
space:
mode:
Commitfd96738eca7dc262616e73bb00d4abed7b975497 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-07 11:07:45 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-07 11:07:45 +0300
Filescf3ae9a94900edb34ab77bc4ba8e40f6c185b043 /src/Generic/List/List.hpp
FMI-OOP-P1_TicketSystem-fd96738eca7dc262616e73bb00d4abed7b975497.tar
FMI-OOP-P1_TicketSystem-fd96738eca7dc262616e73bb00d4abed7b975497.tar.gz
FMI-OOP-P1_TicketSystem-fd96738eca7dc262616e73bb00d4abed7b975497.zip
Parent572034064bc8579cda9cebb28e657c79e5c96e3d (diff)
Autocommit at 07.05.2022 @ 11:07
1 files changed, 4 insertions, 4 deletions
-rw-r--r--src/Generic/List/List.hpp8
diff --git a/src/Generic/List/List.hpp b/src/Generic/List/List.hpp
index 7088f2e..c798590 100644
--- a/src/Generic/List/List.hpp
+++ b/src/Generic/List/List.hpp
@@ -17,8 +17,8 @@ protected:
public:
List(const T* elements, unsigned elementsCount);
- void add(const T& element);
- void insertAt(const T& element, unsigned index);
+ void add(T element);
+ void insertAt(T element, unsigned index);
bool removeAt(unsigned index);
unsigned findIndex(const T& element) const;
bool contain(const T& element) const;
@@ -78,14 +78,14 @@ List<T>::List(const T* elements, unsigned elementsCount) {
}
template <class T>
-void List<T>::add(const T& element) {
+void List<T>::add(T element) {
if (length == count) resize();
elements[count++] = element;
}
template <class T>
-void List<T>::insertAt(const T& element, unsigned index) {
+void List<T>::insertAt(T element, unsigned index) {
if (index >= count) add(element);
if (length == count) resize();