From ace674e518c18a7a48e0daf5641d4006c8f37dca Mon Sep 17 00:00:00 2001 From: apio Date: Sat, 17 Dec 2022 13:49:47 +0100 Subject: [PATCH] LinkedList: Make sure the contained type inherits from DoublyLinkedListNode --- luna/include/luna/LinkedList.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/luna/include/luna/LinkedList.h b/luna/include/luna/LinkedList.h index 47a07cbf..80c9b240 100644 --- a/luna/include/luna/LinkedList.h +++ b/luna/include/luna/LinkedList.h @@ -1,5 +1,6 @@ #pragma once #include +#include template inline Option nonnull_or_error(T* ptr) { @@ -57,6 +58,8 @@ template class DoublyLinkedList { using Node = DoublyLinkedListNode; + static_assert(IsBaseOf, T>); + public: void append(T* ptr) {