| 15 | |
| 16 | template <typename Axis> |
| 17 | class iterator_over |
| 18 | : public iterator_facade<iterator_over<Axis>, typename Axis::bin_type, |
| 19 | random_access_traversal_tag, |
| 20 | typename Axis::bin_type> { |
| 21 | public: |
| 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 | |
| 28 | protected: |
| 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 | |
| 45 | template <typename Axis> |
| 46 | class reverse_iterator_over |
nothing calls this directly
no outgoing calls
no test coverage detected