Lines Matching refs:T
33 template<typename T>
35 LinkedListEntry<T>* next;
36 T* element;
40 template<typename T>
44 LinkedListIterator(const LinkedListIterator<T>& that) : entry_(that.entry_) {} in LinkedListIterator()
45 explicit LinkedListIterator(LinkedListEntry<T>* entry) : entry_(entry) {} in LinkedListIterator()
47 LinkedListIterator<T>& operator=(const LinkedListIterator<T>& that) {
52 LinkedListIterator<T>& operator++() {
57 T* const operator*() {
61 bool operator==(const LinkedListIterator<T>& that) const {
65 bool operator!=(const LinkedListIterator<T>& that) const {
70 LinkedListEntry<T> *entry_;
76 template<typename T, typename Allocator>
79 typedef LinkedListIterator<T> iterator;
80 typedef T* value_type;
86 LinkedListEntry<T>* head;
87 LinkedListEntry<T>* tail;
92 static_assert(sizeof(LinkedListHeader) == sizeof(LinkedListEntry<T>));
93 static_assert(alignof(LinkedListHeader) == alignof(LinkedListEntry<T>));
99 Allocator::free(reinterpret_cast<LinkedListEntry<T>*>(header_)); in ~LinkedList()
112 void push_front(T* const element) { in push_front()
114 LinkedListEntry<T>* new_entry = Allocator::alloc(); in push_front()
123 void push_back(T* const element) { in push_back()
125 LinkedListEntry<T>* new_entry = Allocator::alloc(); in push_back()
136 T* pop_front() { in pop_front()
139 LinkedListEntry<T>* entry = header_->head; in pop_front()
140 T* element = entry->element; in pop_front()
151 T* front() const { in front()
159 LinkedListEntry<T>* p = header_->head; in clear()
169 visit([&] (T* si) { in for_each()
177 for (LinkedListEntry<T>* e = head(); e != nullptr; e = e->next) { in visit()
188 for (LinkedListEntry<T>* e = header_->head, *p = nullptr; e != nullptr;) { in remove_if()
190 LinkedListEntry<T>* next = e->next; in remove_if()
211 void remove(T* element) { in remove()
212 remove_if([&](T* e) { in remove()
218 T* find_if(F predicate) const { in find_if()
219 for (LinkedListEntry<T>* e = head(); e != nullptr; e = e->next) { in find_if()
236 iterator find(T* value) const { in find()
237 for (LinkedListEntry<T>* e = head(); e != nullptr; e = e->next) { in find()
246 size_t copy_to_array(T* array[], size_t array_length) const { in copy_to_array()
248 for (LinkedListEntry<T>* e = head(); sz < array_length && e != nullptr; e = e->next) { in copy_to_array()
255 bool contains(const T* el) const { in contains()
256 for (LinkedListEntry<T>* e = head(); e != nullptr; e = e->next) { in contains()
264 static LinkedList make_list(T* const element) { in make_list()
265 LinkedList<T, Allocator> one_element_list; in make_list()
272 for_each([&](T*) { ++result; }); in size()
284 LinkedListEntry<T>* head() const { in head()