Website Summary Files Commits Branches @commit @diff @stats
path: root / src / List / List.cpp
diff options
context:
space:
mode:
1 files changed, 8 insertions, 0 deletions
-rw-r--r--src/List/List.cpp8
diff --git a/src/List/List.cpp b/src/List/List.cpp
index 7236616..d5c2f04 100644
--- a/src/List/List.cpp
+++ b/src/List/List.cpp
@@ -64,6 +64,14 @@ bool List<T>::removeAt(unsigned index) {
}
template <class T>
+unsigned List<T>::findIndex(const T& element) const {
+ unsigned ind = 0;
+ while (ind < count && elements[ind].compare(element) != 0)
+ ind++;
+ return ind;
+}
+
+template <class T>
T& List<T>::operator[](unsigned index) {
return elements[index];
}