llvm.org GIT mirror llvm / f7235cd
Properly convert some &'s to &'s git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5868 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 17 years ago
1 changed file(s) with 16 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
377377 public std::iterator {
378378 friend class container;
379379 public:
380 const value_type& operator*() const;
380 const value_type& operator*() const;
381381 const value_type* operator->() const;
382 const_iterator& operator++();
382 const_iterator& operator++();
383383 const_iterator operator++(int);
384384 friend bool operator==(const_iterator lhs,
385385 const_iterator rhs);
407407 There are normally only three member functions that need nontrivial
408408 implementations; the rest are just boilerplate.
409409
410 const container::value_type&
410 const container::value_type&
411411 container::const_iterator::operator*() const {
412412 // find the element and return a reference to it
413413 }
414414
415415 const container::value_type*
416416 container::const_iterator::operator->() const {
417 return &**this;
417 return &**this;
418418 }
419419
420420 If there's an underlying real container, operator*() can just return a
430430 The operator->() function is just boilerplate around a call to
431431 operator*().
432432
433 container::const_iterator&
433 container::const_iterator&
434434 container::const_iterator::operator++() {
435435 // the incrementing logic goes here
436436 return *this;
490490 friend class container;
491491 friend class container::const_iterator;
492492 public:
493 value_type& operator*() const;
493 value_type& operator*() const;
494494 value_type* operator->() const;
495 iterator& operator++();
495 iterator& operator++();
496496 iterator operator++(int);
497497 friend bool operator==(iterator lhs, iterator rhs);
498498 friend bool operator!=(iterator lhs, iterator rhs);
504504 friend class container;
505505 public:
506506 const_iterator();
507 const_iterator(const iterator& i);
508 const value_type& operator*() const;
507 const_iterator(const iterator& i);
508 const value_type& operator*() const;
509509 const value_type* operator->() const;
510 const_iterator& operator++();
510 const_iterator& operator++();
511511 const_iterator operator++(int);
512512 friend bool operator==(const_iterator lhs,
513513 const_iterator rhs);
536536 public std::iterator {
537537 public:
538538 //...
539 iterator& operator--();
539 iterator& operator--();
540540 iterator operator--(int);
541541 //...
542542 };
550550 public std::iterator {
551551 public:
552552 //...
553 iterator& operator+=(difference_type rhs);
554 iterator& operator-=(difference_type rhs);
553 iterator& operator+=(difference_type rhs);
554 iterator& operator-=(difference_type rhs);
555555 friend iterator operator+(iterator lhs, difference_type rhs);
556556 friend iterator operator+(difference_type lhs, iterator rhs);
557557 friend iterator operator-(iterator lhs, difference_type rhs);
563563 //...
564564 };
565565
566 container::iterator&
566 container::iterator&
567567 container::iterator::operator+=(container::difference_type rhs) {
568568 // add rhs to iterator position
569569 return *this;
570570 }
571571
572 container::iterator&
572 container::iterator&
573573 container::iterator::operator-=(container::difference_type rhs) {
574574 // subtract rhs from iterator position
575575 return *this;
659659
Chris Lattner
660660
661661
662 Last modified: Sun Jan 20 13:01:02 CST 2002
662 Last modified: Wed Apr 23 11:20:49 CDT 2003
663663
664664
665665