3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00
This commit is contained in:
Nikolaj Bjorner 2021-06-17 13:18:19 -07:00
parent f7d1cce69a
commit 4a0a678e3f
4 changed files with 41 additions and 9 deletions

View file

@ -74,6 +74,10 @@ public:
}
}
static void detach(T* elem) {
elem->init(elem);
}
bool invariant() const {
auto* e = this;
do {
@ -84,6 +88,20 @@ public:
while (e != this);
return true;
}
static bool contains(T* list, T* elem) {
if (!list)
return false;
T* first = list;
do {
if (list == elem)
return true;
list = list->m_next;
}
while (list != first);
return false;
}
};