How to remove from an etl::intrusive_list #872
Replies: 6 comments 1 reply
-
I originally wrote the intrusive containers to act as much like their non-intrusive counterparts as possible. |
Beta Was this translation helpful? Give feedback.
-
My bad, I just realised that the |
Beta Was this translation helpful? Give feedback.
-
I think that The function that maybe should be overloaded is |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I propose that this member function is added. It takes a reference to a node. If the node is in the list it either returns a pointer to the next node in the list If the node is not in the list it returns
|
Beta Was this translation helpful? Give feedback.
-
Hi. Would it be possible to have a less safe |
Beta Was this translation helpful? Give feedback.
-
I have been manually writing intrusive list code in my applications. I wanted to write a template classes to perform all the logic of an intrusive list instead of doing it manually over and over. But I discovered that ETL already has an intrusive_list type that seems to do what I want. I understand how an item is added to the list.
However, I can't figure out how to remove an item from the list. Using the remove method isn't quite right because it requires the underlying type has operator== (which doesn't check that the items being remove is the same item, only that it is logically equivalent). If I were writing an intrusive list myself, the "remove" method would take a pointer (or reference) to the node, it would then search the list to make sure the node is actually a part of the list, then remove the item from the list by changing the intrusive links.
Is there a way to do this with etl::intrusive_list?
Beta Was this translation helpful? Give feedback.
All reactions