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

Class const_iterator

src/fl/stl/list.h:137–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135 };
136
137 class const_iterator {
138 public:
139 typedef T value_type;
140 typedef const T& reference;
141 typedef const T* pointer;
142 typedef fl::ptrdiff_t difference_type;
143 typedef fl::bidirectional_iterator_tag iterator_category;
144
145 private:
146 const Node* mNode;
147 friend class list;
148
149 public:
150 const_iterator(const Node* node) : mNode(node) {}
151 const_iterator(const iterator& it) : mNode(it.mNode) {}
152
153 const T& operator*() const {
154 return mNode->data;
155 }
156
157 const T* operator->() const {
158 return &mNode->data;
159 }
160
161 const_iterator& operator++() {
162 mNode = mNode->next;
163 return *this;
164 }
165
166 const_iterator operator++(int) {
167 const_iterator temp = *this;
168 mNode = mNode->next;
169 return temp;
170 }
171
172 const_iterator& operator--() {
173 mNode = mNode->prev;
174 return *this;
175 }
176
177 const_iterator operator--(int) {
178 const_iterator temp = *this;
179 mNode = mNode->prev;
180 return temp;
181 }
182
183 bool operator==(const const_iterator& other) const {
184 return mNode == other.mNode;
185 }
186
187 bool operator!=(const const_iterator& other) const {
188 return mNode != other.mNode;
189 }
190 };
191
192 typedef fl::reverse_iterator<iterator> reverse_iterator;
193 typedef fl::reverse_iterator<const_iterator> const_reverse_iterator;

Callers 15

beginMethod · 0.70
cbeginMethod · 0.70
endMethod · 0.70
cendMethod · 0.70
findMethod · 0.70
lower_boundMethod · 0.70
upper_boundMethod · 0.70
beginMethod · 0.70
cbeginMethod · 0.70
endMethod · 0.70
cendMethod · 0.70
findMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected