From ecd15e3f6731a8298e9cd3ebc45e1875e8c19063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 19 Feb 2019 10:05:45 +0100 Subject: Now it links, but segfaults. --- linked_list.cpp | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'linked_list.cpp') diff --git a/linked_list.cpp b/linked_list.cpp index b30458c9..ed37eb23 100644 --- a/linked_list.cpp +++ b/linked_list.cpp @@ -1,15 +1,5 @@ #include "linked_list.h" -template -llist::llist () { - this->length = 0; - this->cur = this->head = new llink; - this->tail = new llink; - - head->after = tail; - tail->before = head; -} - template llink::~llink () { this.unlink(); @@ -21,22 +11,6 @@ void llink::unlink () { if (this->after != nullptr) this->after->before = this->before; } -template -void llist::push(T* val) { - auto l = new llink(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 T& llist::peek() { if (this->empty()) return nullptr; -- cgit v1.2.3