aboutsummaryrefslogtreecommitdiff
path: root/linked_list.cpp
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-02-19 10:05:45 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-02-19 10:18:33 +0100
commitecd15e3f6731a8298e9cd3ebc45e1875e8c19063 (patch)
treed976a5fd710cc39350a37a2aa2f37fd08d0926f5 /linked_list.cpp
parentNo idea, to tired. (diff)
downloadcalp-ecd15e3f6731a8298e9cd3ebc45e1875e8c19063.tar.gz
calp-ecd15e3f6731a8298e9cd3ebc45e1875e8c19063.tar.xz
Now it links, but segfaults.
Diffstat (limited to 'linked_list.cpp')
-rw-r--r--linked_list.cpp26
1 files changed, 0 insertions, 26 deletions
diff --git a/linked_list.cpp b/linked_list.cpp
index b30458c9..ed37eb23 100644
--- a/linked_list.cpp
+++ b/linked_list.cpp
@@ -1,16 +1,6 @@
#include "linked_list.h"
template <typename T>
-llist<T>::llist () {
- this->length = 0;
- this->cur = this->head = new llink<T>;
- this->tail = new llink<T>;
-
- head->after = tail;
- tail->before = head;
-}
-
-template <typename T>
llink<T>::~llink () {
this.unlink();
}
@@ -22,22 +12,6 @@ void llink<T>::unlink () {
}
template <typename T>
-void llist<T>::push(T* val) {
- auto l = new llink<T>(val);
-
- l->after = FIRST(this);
- FIRST(this) = l;
-
- l->after->before = l;
- l->before = this->head;
-
- ++this->length;
-
- // TODO do I want to change that?
- this->cur = l;
-}
-
-template <typename T>
T& llist<T>::peek() {
if (this->empty()) return nullptr;