mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
This commit is contained in:
parent
f7d1cce69a
commit
4a0a678e3f
4 changed files with 41 additions and 9 deletions
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue