Add some ListNode helper methods.

GitOrigin-RevId: b4e79174cac16752185cc8bfa2436b7393464289
This commit is contained in:
levlam 2020-06-09 17:39:34 +03:00
parent cd451b7c45
commit 2a623b0a50

View File

@ -83,7 +83,20 @@ struct ListNode {
return next == this;
}
private:
ListNode *begin() {
return next;
}
ListNode *end() {
return this;
}
ListNode *get_next() {
return next;
}
ListNode *get_prev() {
return prev;
}
protected:
void clear() {
next = this;
prev = this;