MCPcopy Create free account
hub / github.com/Norbyte/bg3se / ContiguousConstIterator

Class ContiguousConstIterator

CoreLib/Base/BaseArray.h:98–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96
97template <class T>
98class ContiguousConstIterator
99{
100public:
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

Callers 2

operator +Method · 0.85
operator -Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected