Skip to content

Commit

Permalink
Index iteration: avoid invalidated pointers entirely.
Browse files Browse the repository at this point in the history
IndexRef is like a pointer, except it just stores a pointer to the container
and an index. Any invalid (out of range) IndexRef is equal to any other.
IndexIterator is an iterator over all IndexRef values for a container,
used to have a range-for loop where not only every loop,
but every access through the iterated value, gets looked up based
on index.

If this looks appealing I'll move the code out of the main
consuming CPP file into someplace where the other files can use it.
  • Loading branch information
rpavlik committed Sep 9, 2019
1 parent 5ab6052 commit 6abbf07
Showing 1 changed file with 257 additions and 70 deletions.

0 comments on commit 6abbf07

Please sign in to comment.