MCPcopy Create free account
hub / github.com/FastLED/FastLED / iterator

Class iterator

src/fl/stl/list.h:83–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81public:
82 // Iterator implementation
83 class iterator {
84 public:
85 typedef T value_type;
86 typedef T& reference;
87 typedef T* pointer;
88 typedef fl::ptrdiff_t difference_type;
89 typedef fl::bidirectional_iterator_tag iterator_category;
90
91 private:
92 Node* mNode;
93 friend class list;
94
95 public:
96 iterator(Node* node) : mNode(node) {}
97
98 T& operator*() const {
99 return mNode->data;
100 }
101
102 T* operator->() const {
103 return &mNode->data;
104 }
105
106 iterator& operator++() {
107 mNode = mNode->next;
108 return *this;
109 }
110
111 iterator operator++(int) {
112 iterator temp = *this;
113 mNode = mNode->next;
114 return temp;
115 }
116
117 iterator& operator--() {
118 mNode = mNode->prev;
119 return *this;
120 }
121
122 iterator operator--(int) {
123 iterator temp = *this;
124 mNode = mNode->prev;
125 return temp;
126 }
127
128 bool operator==(const iterator& other) const {
129 return mNode == other.mNode;
130 }
131
132 bool operator!=(const iterator& other) const {
133 return mNode != other.mNode;
134 }
135 };
136
137 class const_iterator {
138 public:

Callers 15

beginMethod · 0.70
endMethod · 0.70
insertMethod · 0.70
emplaceMethod · 0.70
eraseMethod · 0.70
findMethod · 0.70
lower_boundMethod · 0.70
upper_boundMethod · 0.70
beginMethod · 0.70
endMethod · 0.70
insertMethod · 0.70
emplaceMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected