76 std::conditional_t<Const, typename TreeSet<Dim>::container_type::const_iterator,
84 using iterator_category = std::forward_iterator_tag;
85 using difference_type = std::ptrdiff_t;
86 using value_type =
typename std::iterator_traits<RawIterator>::value_type;
87 using reference =
typename std::iterator_traits<RawIterator>::reference;
88 using pointer =
typename std::iterator_traits<RawIterator>::pointer;
95 template <
bool Const2, std::enable_if_t<Const && !Const2,
bool> = true>
107 if (++it_ == last_) {
120 reference operator*()
const {
return *it_; }
122 pointer operator->()
const {
return &*it_; }
124 template <
bool Const2>
127 return it_ == other.it_;
130 template <
bool Const2>
133 return !(*
this == other);
137 [[nodiscard]]
bool returnable(
TreeIndex node)
const
139 return ts_->isPureLeaf(node) && !ts_->empty(node);
142 [[nodiscard]]
bool traversable(
TreeIndex node)
const {
return ts_->isParent(node); }
146 while (root_ != cur_) {
147 if (BF - 1 == cur_.offset) {
148 cur_ = ts_->parent(cur_);
154 if (nextNodeDownwards()) {
169 bool nextNodeDownwards()
172 if (returnable(cur_)) {
173 it_ = ts_->values(cur_).begin();
174 last_ = ts_->values(cur_).end();
176 }
else if (traversable(cur_)) {
177 cur_ = ts_->child(cur_, 0);
185 [[nodiscard]] RawIterator iterator() {
return it_; }
190 if (nextNodeDownwards()) {
198 template <
bool Const2, std::enable_if_t<!Const && Const2,
bool> = true>
200 : ts_(other.ts_), root_(other.root_), cur_(other.cur_)
203 it_ = ts_->values(cur_).erase(other.it_, other.it_);
204 last_ = ts_->values(cur_).erase(other.last_, other.last_);