LinkedList: Make sure the contained type inherits from DoublyLinkedListNode<T>
This commit is contained in:
parent
2cbc9fa385
commit
ace674e518
@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include <luna/Option.h>
|
||||
#include <luna/TypeTraits.h>
|
||||
|
||||
template <typename T> inline Option<T*> nonnull_or_error(T* ptr)
|
||||
{
|
||||
@ -57,6 +58,8 @@ template <typename T> class DoublyLinkedList
|
||||
{
|
||||
using Node = DoublyLinkedListNode<T>;
|
||||
|
||||
static_assert(IsBaseOf<DoublyLinkedListNode<T>, T>);
|
||||
|
||||
public:
|
||||
void append(T* ptr)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user