diff options
Diffstat (limited to 'rbtree.h')
-rw-r--r-- | rbtree.h | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -49,16 +49,10 @@ public: { RB_INIT(&head); } - virtual ~RBTree() { - RBEntry *cur; - - while ((cur = min())) { - remove(cur); - delete cur; - } + clear(); } inline RBEntry * @@ -92,6 +86,17 @@ public: { return RB_MAX(Tree, &head); } + + inline void + clear(void) + { + RBEntry *cur; + + while ((cur = min())) { + remove(cur); + delete cur; + } + } }; template <typename KeyType, typename ValueType> |