MCPcopy Create free account
hub / github.com/boostorg/histogram / iterator_over

Class iterator_over

include/boost/histogram/axis/iterator.hpp:17–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15
16template <typename Axis>
17class iterator_over
18 : public iterator_facade<iterator_over<Axis>, typename Axis::bin_type,
19 random_access_traversal_tag,
20 typename Axis::bin_type> {
21public:
22 explicit iterator_over(const Axis& axis, int idx)
23 : axis_(axis), idx_(idx) {}
24
25 iterator_over(const iterator_over&) = default;
26 iterator_over& operator=(const iterator_over&) = default;
27
28protected:
29 void increment() noexcept { ++idx_; }
30 void decrement() noexcept { --idx_; }
31 void advance(int n) noexcept { idx_ += n; }
32 int distance_to(const iterator_over& other) const noexcept {
33 return other.idx_ - idx_;
34 }
35 bool equal(const iterator_over& other) const noexcept {
36 return &axis_ == &other.axis_ && idx_ == other.idx_;
37 }
38 typename Axis::bin_type dereference() const { return axis_[idx_]; }
39 friend class ::boost::iterator_core_access;
40
41 const Axis& axis_;
42 int idx_;
43};
44
45template <typename Axis>
46class reverse_iterator_over

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected