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;
|
||||
return *this;
|
||||
}
|
||||
IntrusiveListIterator operator++(int) {
|
||||
IntrusiveListIterator it(*this);
|
||||
node = node == root ? node : node->next;
|
||||
return it;
|
||||
}
|
||||
IntrusiveListIterator& operator--() {
|
||||
node = node->prev == root ? node : node->prev;
|
||||
return *this;
|
||||
}
|
||||
IntrusiveListIterator operator++(int) {
|
||||
IntrusiveListIterator it(*this);
|
||||
++*this;
|
||||
return it;
|
||||
}
|
||||
IntrusiveListIterator operator--(int) {
|
||||
IntrusiveListIterator it(*this);
|
||||
node = node->prev == root ? node : node->prev;
|
||||
--*this;
|
||||
return it;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue