Closed crusader-mike closed 2 years ago
Yes for points 2 and 3. However for point 1 that is not possible, You need a mutable reference to the RBTree
itself to remove an element from it. Consider the case where this is the last element in the tree: you need to be able to update the RBTree
itself to set its root node pointer to null.
I am not sure about rbtree
implementation, but in theory it shouldn't be a problem -- just like in case of a keyring
(double-linked list with special null
node) removing last element will simply make null node it's own neighbor...
(For reasons outside of this question) I need to build an intrusive RB tree where:
drop
implementationIs it possible to do this with
intrusive_collections::rbtree::RBTree
?