3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00

viable 2 with dlist

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2021-11-10 14:43:10 -08:00
parent 0bec8520e1
commit c9f5ce43b2
7 changed files with 128 additions and 45 deletions

View file

@ -40,6 +40,14 @@ public:
remove_from(list, head);
return head;
}
void insert(T* elem) {
T* next = this->m_next;
elem->m_prev = next->m_prev;
elem->m_next = next;
this->m_next = elem;
next->m_prev = elem;
}
static void remove_from(T*& list, T* elem) {
if (list->m_next == list) {