| 96 | |
| 97 | template <class T> |
| 98 | class ContiguousConstIterator |
| 99 | { |
| 100 | public: |
| 101 | using value_type = T; |
| 102 | using reference = T const&; |
| 103 | using pointer = T const*; |
| 104 | using difference_type = int32_t; |
| 105 | using size_type = uint32_t; |
| 106 | using iterator_category = std::contiguous_iterator_tag; |
| 107 | |
| 108 | ContiguousConstIterator(T const* p) : ptr_(p) {} |
| 109 | |
| 110 | ContiguousConstIterator operator ++ () |
| 111 | { |
| 112 | ++ptr_; |
| 113 | return *this; |
| 114 | } |
| 115 | |
| 116 | ContiguousConstIterator operator -- () |
| 117 | { |
| 118 | --ptr_; |
| 119 | return *this; |
| 120 | } |
| 121 | |
| 122 | ContiguousConstIterator& operator ++ (int) |
| 123 | { |
| 124 | ContiguousConstIterator<T> it(ptr_); |
| 125 | ++ptr_; |
| 126 | return it; |
| 127 | } |
| 128 | |
| 129 | ContiguousConstIterator& operator -- (int) |
| 130 | { |
| 131 | ContiguousConstIterator<T> it(ptr_); |
| 132 | --ptr_; |
| 133 | return it; |
| 134 | } |
| 135 | |
| 136 | bool operator == (ContiguousConstIterator const& it) const |
| 137 | { |
| 138 | return it.ptr_ == ptr_; |
| 139 | } |
| 140 | |
| 141 | bool operator != (ContiguousConstIterator const& it) const |
| 142 | { |
| 143 | return it.ptr_ != ptr_; |
| 144 | } |
| 145 | |
| 146 | bool operator < (ContiguousConstIterator const& it) const |
| 147 | { |
| 148 | return ptr_ < it.ptr_; |
| 149 | } |
| 150 | |
| 151 | ContiguousConstIterator operator + (difference_type n) const |
| 152 | { |
| 153 | return ContiguousConstIterator(ptr_ + n); |
| 154 | } |
| 155 |
no outgoing calls
no test coverage detected