| 1735 | // btree_iterator methods |
| 1736 | template <typename N, typename R, typename P> |
| 1737 | void btree_iterator<N, R, P>::increment_slow() { |
| 1738 | if (node->leaf()) { |
| 1739 | assert(position >= node->count()); |
| 1740 | btree_iterator save(*this); |
| 1741 | while (position == node->count() && !node->is_root()) { |
| 1742 | assert(node->parent()->child(node->position()) == node); |
| 1743 | position = node->position(); |
| 1744 | node = node->parent(); |
| 1745 | } |
| 1746 | if (position == node->count()) { |
| 1747 | *this = save; |
| 1748 | } |
| 1749 | } else { |
| 1750 | assert(position < node->count()); |
| 1751 | node = node->child(position + 1); |
| 1752 | while (!node->leaf()) { |
| 1753 | node = node->child(0); |
| 1754 | } |
| 1755 | position = 0; |
| 1756 | } |
| 1757 | } |
| 1758 | |
| 1759 | template <typename N, typename R, typename P> |
| 1760 | void btree_iterator<N, R, P>::decrement_slow() { |