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
|
#pragma once
|
||||||
#include <luna/Option.h>
|
#include <luna/Option.h>
|
||||||
|
#include <luna/TypeTraits.h>
|
||||||
|
|
||||||
template <typename T> inline Option<T*> nonnull_or_error(T* ptr)
|
template <typename T> inline Option<T*> nonnull_or_error(T* ptr)
|
||||||
{
|
{
|
||||||
@ -57,6 +58,8 @@ template <typename T> class DoublyLinkedList
|
|||||||
{
|
{
|
||||||
using Node = DoublyLinkedListNode<T>;
|
using Node = DoublyLinkedListNode<T>;
|
||||||
|
|
||||||
|
static_assert(IsBaseOf<DoublyLinkedListNode<T>, T>);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void append(T* ptr)
|
void append(T* ptr)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user