diff --git a/gdbsupport/intrusive_list.h b/gdbsupport/intrusive_list.h index 77eeeeec5fd..6812266159a 100644 --- a/gdbsupport/intrusive_list.h +++ b/gdbsupport/intrusive_list.h @@ -24,15 +24,26 @@ /* A list node. The elements put in an intrusive_list either inherit from this, or have a field of this type. */ template -struct intrusive_list_node +class intrusive_list_node { +public: bool is_linked () const { return next != INTRUSIVE_LIST_UNLINKED_VALUE; } +private: T *next = INTRUSIVE_LIST_UNLINKED_VALUE; T *prev = INTRUSIVE_LIST_UNLINKED_VALUE; + + template + friend struct intrusive_list_iterator; + + template + friend struct intrusive_list_reverse_iterator; + + template + friend struct intrusive_list; }; /* Follows a couple types used by intrusive_list as template parameter to find