CMS 3D CMS Logo

const_iterator.h
Go to the documentation of this file.
1 #ifndef Candidate_const_iterator_h
2 #define Candidate_const_iterator_h
3 
4 /* \class reco::candidate::const_iterator
5  *
6  * \author Luca Lista, INFN
7  *
8  */
11 
12 namespace reco {
13  namespace candidate {
14  struct const_iterator {
15  typedef const Candidate value_type;
16  typedef const Candidate* pointer;
17  typedef const Candidate& reference;
18  typedef ptrdiff_t difference_type;
19  typedef std::vector<int>::const_iterator::iterator_category iterator_category;
20  const_iterator() : me(nullptr), i(0) {}
22  const_iterator(const iterator& it) : me(it.me), i(it.i) {}
24  me = it.me;
25  i = it.i;
26  return *this;
27  }
29  ++i;
30  return *this;
31  }
33  const_iterator ci = *this;
34  ++i;
35  return ci;
36  }
38  --i;
39  return *this;
40  }
42  const_iterator ci = *this;
43  --i;
44  return ci;
45  }
46  difference_type operator-(const const_iterator& o) const { return i - o.i; }
48  const_iterator ci = *this;
49  ci.i += n;
50  return ci;
51  }
53  const_iterator ci = *this;
54  ci.i -= n;
55  return ci;
56  }
57  bool operator<(const const_iterator& o) { return i < o.i; }
58  bool operator==(const const_iterator& ci) const { return i == ci.i; }
59  bool operator!=(const const_iterator& ci) const { return i != ci.i; }
60  inline reference operator*() const;
61  pointer operator->() const { return &(operator*()); }
63  i += d;
64  return *this;
65  }
67  i -= d;
68  return *this;
69  }
70 
71  private:
74  };
75 
76  } // namespace candidate
77 } // namespace reco
78 
79 #endif
reference operator*() const
Definition: Candidate.h:301
const_iterator & operator+=(difference_type d)
bool operator==(const const_iterator &ci) const
const_iterator operator++(int)
difference_type i
Definition: iterator.h:68
const_iterator operator-(difference_type n) const
bool operator!=(const const_iterator &ci) const
const_iterator(pointer ime, difference_type ii)
difference_type operator-(const const_iterator &o) const
d
Definition: ztail.py:151
ii
Definition: cuy.py:589
const_iterator & operator=(const iterator &it)
std::vector< int >::const_iterator::iterator_category iterator_category
const_iterator(const iterator &it)
const_iterator operator--(int)
bool operator<(const const_iterator &o)
const_iterator operator+(difference_type n) const
fixed size matrix
const_iterator & operator-=(difference_type d)