@@ -186,39 +186,38 @@ template<typename Ty>
186186struct ilist_traits <const Ty> : public ilist_traits<Ty> {};
187187
188188// ===----------------------------------------------------------------------===//
189- // ilist_iterator<Node> - Iterator for intrusive list.
189+ // Iterator for intrusive list.
190190//
191- template <typename NodeTy>
191+ template <typename NodeTy>
192192class ilist_iterator
193- : public std::iterator<std::bidirectional_iterator_tag, NodeTy, ptrdiff_t > {
194-
193+ : public std::iterator<std::bidirectional_iterator_tag, NodeTy, ptrdiff_t > {
195194public:
196195 typedef ilist_traits<NodeTy> Traits;
197- typedef std::iterator<std::bidirectional_iterator_tag,
198- NodeTy, ptrdiff_t > super;
196+ typedef std::iterator<std::bidirectional_iterator_tag, NodeTy, ptrdiff_t >
197+ super;
199198
200199 typedef typename super::value_type value_type;
201200 typedef typename super::difference_type difference_type;
202201 typedef typename super::pointer pointer;
203202 typedef typename super::reference reference;
203+
204204private:
205205 pointer NodePtr;
206206
207207public:
208-
209208 explicit ilist_iterator (pointer NP) : NodePtr(NP) {}
210209 explicit ilist_iterator (reference NR) : NodePtr(&NR) {}
211210 ilist_iterator () : NodePtr(nullptr ) {}
212211
213212 // This is templated so that we can allow constructing a const iterator from
214213 // a nonconst iterator...
215- template <class node_ty >
214+ template <class node_ty >
216215 ilist_iterator (const ilist_iterator<node_ty> &RHS)
217- : NodePtr(RHS.getNodePtrUnchecked()) {}
216+ : NodePtr(RHS.getNodePtrUnchecked()) {}
218217
219218 // This is templated so that we can allow assigning to a const iterator from
220219 // a nonconst iterator...
221- template <class node_ty >
220+ template <class node_ty >
222221 const ilist_iterator &operator =(const ilist_iterator<node_ty> &RHS) {
223222 NodePtr = RHS.getNodePtrUnchecked ();
224223 return *this ;
@@ -227,13 +226,8 @@ class ilist_iterator
227226 void reset (pointer NP) { NodePtr = NP; }
228227
229228 // Accessors...
230- explicit operator pointer () const {
231- return NodePtr;
232- }
233-
234- reference operator *() const {
235- return *NodePtr;
236- }
229+ explicit operator pointer () const { return NodePtr; }
230+ reference operator *() const { return *NodePtr; }
237231 pointer operator ->() const { return &operator *(); }
238232
239233 // Comparison operators
@@ -245,21 +239,21 @@ class ilist_iterator
245239 }
246240
247241 // Increment and decrement operators...
248- ilist_iterator &operator --() { // predecrement - Back up
242+ ilist_iterator &operator --() {
249243 NodePtr = Traits::getPrev (NodePtr);
250244 assert (NodePtr && " --'d off the beginning of an ilist!" );
251245 return *this ;
252246 }
253- ilist_iterator &operator ++() { // preincrement - Advance
247+ ilist_iterator &operator ++() {
254248 NodePtr = Traits::getNext (NodePtr);
255249 return *this ;
256250 }
257- ilist_iterator operator --(int ) { // postdecrement operators...
251+ ilist_iterator operator --(int ) {
258252 ilist_iterator tmp = *this ;
259253 --*this ;
260254 return tmp;
261255 }
262- ilist_iterator operator ++(int ) { // postincrement operators...
256+ ilist_iterator operator ++(int ) {
263257 ilist_iterator tmp = *this ;
264258 ++*this ;
265259 return tmp;
0 commit comments