72 using iterator_category = std::random_access_iterator_tag;
73 using difference_type = std::ptrdiff_t;
74 using value_type =
typename TreeContainer<Ts...>::template bucket_type<T>;
75 using pointer = std::conditional_t<Const, value_type const*, value_type*>;
76 using reference = std::conditional_t<Const, value_type const&, value_type&>;
82 template <
bool Const2,
class = std::enable_if_t<Const && !Const2>>
85 : container_(other.container_), idx_(other.idx_)
141 reference operator[](difference_type pos)
const
143 return container_->template bucket<T>((idx_ + pos) *
144 container_->numBlocksPerBucket());
147 reference operator*()
const
149 return container_->template bucket<T>(idx_ * container_->numBlocksPerBucket());
152 pointer operator->()
const
154 return &(container_->template bucket<T>(idx_ * container_->numBlocksPerBucket()));
157 template <
bool Const1,
bool Const2>
158 friend difference_type operator-(
162 return lhs.idx_ - rhs.idx_;
165 template <
bool Const1,
bool Const2>
169 return lhs.idx_ == rhs.idx_;
172 template <
bool Const1,
bool Const2>
176 return lhs.idx_ != rhs.idx_;
179 template <
bool Const1,
bool Const2>
183 return lhs.idx_ < rhs.idx_;
186 template <
bool Const1,
bool Const2>
190 return lhs.idx_ <= rhs.idx_;
193 template <
bool Const1,
bool Const2>
197 return lhs.idx_ > rhs.idx_;
200 template <
bool Const1,
bool Const2>
204 return lhs.idx_ >= rhs.idx_;
209 : container_(container), idx_(idx)
221 difference_type idx_;