5#ifndef V8_BASE_DOUBLY_THREADED_LIST_H_
6#define V8_BASE_DOUBLY_THREADED_LIST_H_
16 static T**
prev(T t) {
return t->prev(); }
17 static T*
next(T t) {
return t->next(); }
29template <
class T,
class DTLTraits = DoublyThreadedListTraits<T>>
66 if (*DTLTraits::prev(
x) ==
nullptr) {
71 T** prev = DTLTraits::prev(
x);
72 T* next = DTLTraits::next(
x);
74 if (DTLTraits::non_empty(*next)) *DTLTraits::prev(*next) = *prev;
75 *DTLTraits::prev(
x) =
nullptr;
76 *DTLTraits::next(
x) = {};
86 if (DTLTraits::non_empty(
head_)) {
97 *DTLTraits::next(
x) =
head_;
98 *DTLTraits::prev(
x) = &
head_;
99 if (DTLTraits::non_empty(
head_)) {
100 *DTLTraits::prev(
head_) = DTLTraits::next(
x);
124 DCHECK(DTLTraits::non_empty(it.curr_));
126 T next = *DTLTraits::next(curr);
132 const bool in_use = DTLTraits::in_use(needle);
138 for (T element : *
this) {
139 if (element == needle) {
147 static bool empty(T
x) {
return !DTLTraits::non_empty(
x); }
friend DoublyThreadedList
bool operator!=(end_iterator)
bool operator==(end_iterator)
bool Contains(T needle) const
iterator RemoveAt(iterator &it)
DoublyThreadedList(DoublyThreadedList &&other) V8_NOEXCEPT
bool ContainsSlow(T needle) const
DoublyThreadedList()=default
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
static bool non_empty(T t)