diff --git a/include/nn/util/util_IntrusiveList.h b/include/nn/util/util_IntrusiveList.h index 319f43a8d..486a7fc23 100644 --- a/include/nn/util/util_IntrusiveList.h +++ b/include/nn/util/util_IntrusiveList.h @@ -338,6 +338,26 @@ class IntrusiveList { detail::IntrusiveListImplementation m_Implementation; }; +template +class IntrusiveListBaseNode : public IntrusiveListNode { +public: + IntrusiveListBaseNode(); +}; + +template +class IntrusiveListBaseNodeTraits { +public: + using BaseNodeType = IntrusiveListBaseNode; + + static IntrusiveListNode& GetNode(T& ref) { return ref; } + + static const IntrusiveListNode& GetNode(const T& ref) { return ref; } + + static T& GetItem(IntrusiveListNode& node) { return static_cast(node); } + + static const T& GetItem(const IntrusiveListNode& node) { return static_cast(node); } +}; + template class IntrusiveListMemberNodeTraits { friend class IntrusiveList;