+struct SlotIndexIterator
+ : std::iterator<std::random_access_iterator_tag, SlotIndex> {
+
+ SlotIndexIterator() {
+ }
+
+ explicit SlotIndexIterator(LiveInterval::iterator it)
+ : it(it) {
+ }
+
+ SlotIndexIterator(const SlotIndexIterator & that)
+ : it(that.it) {
+ }
+
+ SlotIndexIterator & operator=(const SlotIndexIterator & that) {
+ it = that.it;
+ return *this;
+ }
+
+ SlotIndexIterator & operator++() {
+ ++it;
+ return *this;
+ }
+
+ SlotIndexIterator operator++(int) {
+ SlotIndexIterator that(*this);
+ ++*this;
+ return that;
+ }
+
+ SlotIndexIterator & operator--() {
+ --it;
+ return *this;
+ }
+
+ SlotIndexIterator operator--(int) {
+ SlotIndexIterator that(*this);
+ --*this;
+ return that;
+ }
+
+ SlotIndexIterator & operator+=(std::ptrdiff_t n) {
+ it += n;
+ return *this;
+ }
+
+ SlotIndexIterator & operator-=(std::ptrdiff_t n) {
+ it -= n;
+ return *this;
+ }
+
+ friend bool operator==(SlotIndexIterator lhs, SlotIndexIterator rhs) {
+ return lhs.it == rhs.it;
+ }
+
+ friend bool operator!=(SlotIndexIterator lhs, SlotIndexIterator rhs) {
+ return lhs.it != rhs.it;