I'm trying to wrap my head around generational indexes (sorry for writing it like that, but I don't know how to spell "indices").
I think I get what the basic idea is:
- Each element of the array has a generation.
- Each element is accessed through an index object (which "points to" an element using an index into the array).
- The index object also contains a generation.
- When an element is added to the array it copies the generation of the element to the index object.
- Each time an element is fetched from the list the generation of the index object and the element in the list are compared; only if they match is the list element returned.
- Whenever an element in the array is "deleted" the generation of that
indexelement is increased. (Effectively invalidating all index objects pointing to the old array element).
Is this accurate?
When I read about genidx a while back I read that the array itself keeps track of a generation. What is it used for?