72 using iterator_category = std::random_access_iterator_tag;
73 using difference_type = std::ptrdiff_t;
75 using pointer = std::conditional_t<Const, T const*, T*>;
76 using reference = std::conditional_t<Const, T const&, T&>;
82 template <
bool Const2,
class = std::enable_if_t<Const && !Const2>>
84 : container_(other.container_), idx_(other.idx_)
140 reference operator[](difference_type pos)
const
142 return container_->template get<T>(idx_ + pos);
145 reference operator*()
const {
return container_->template get<T>(idx_); }
147 pointer operator->()
const {
return &(container_->template get<T>(idx_)); }
149 template <
bool Const1,
bool Const2>
153 return lhs.idx_ - rhs.idx_;
156 template <
bool Const1,
bool Const2>
160 return lhs.idx_ == rhs.idx_;
163 template <
bool Const1,
bool Const2>
167 return lhs.idx_ != rhs.idx_;
170 template <
bool Const1,
bool Const2>
174 return lhs.idx_ < rhs.idx_;
177 template <
bool Const1,
bool Const2>
181 return lhs.idx_ <= rhs.idx_;
184 template <
bool Const1,
bool Const2>
188 return lhs.idx_ > rhs.idx_;
191 template <
bool Const1,
bool Const2>
195 return lhs.idx_ >= rhs.idx_;
200 : container_(container), idx_(idx)
212 difference_type idx_;