intrusive_list: De-duplicate some iterator code
These increment/decrement variants can just leverage the other overloads.
This commit is contained in:
parent
4f6ea715b2
commit
79545661b3
1 changed files with 6 additions and 6 deletions
|
@ -68,18 +68,18 @@ public:
|
||||||
node = node == root ? node : node->next;
|
node = node == root ? node : node->next;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
IntrusiveListIterator operator++(int) {
|
|
||||||
IntrusiveListIterator it(*this);
|
|
||||||
node = node == root ? node : node->next;
|
|
||||||
return it;
|
|
||||||
}
|
|
||||||
IntrusiveListIterator& operator--() {
|
IntrusiveListIterator& operator--() {
|
||||||
node = node->prev == root ? node : node->prev;
|
node = node->prev == root ? node : node->prev;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
IntrusiveListIterator operator++(int) {
|
||||||
|
IntrusiveListIterator it(*this);
|
||||||
|
++*this;
|
||||||
|
return it;
|
||||||
|
}
|
||||||
IntrusiveListIterator operator--(int) {
|
IntrusiveListIterator operator--(int) {
|
||||||
IntrusiveListIterator it(*this);
|
IntrusiveListIterator it(*this);
|
||||||
node = node->prev == root ? node : node->prev;
|
--*this;
|
||||||
return it;
|
return it;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue