Here's an index. As you can see, it's got an index, but also a generation https://github.com/steveklabnik/indexlist/blob/master/src/li...
The list itself keeps track of the current generation: https://github.com/steveklabnik/indexlist/blob/master/src/li...
When an entry is removed, this is increased: https://github.com/steveklabnik/indexlist/blob/master/src/li...
Each entry also keeps track of the generation it was inserted with: https://github.com/steveklabnik/indexlist/blob/master/src/li...
When you call get, which takes an Index, the generation is checked https://github.com/steveklabnik/indexlist/blob/master/src/li...
Same as if you try to delete something at a given index: https://github.com/steveklabnik/indexlist/blob/master/src/li...
Does that make sense?
One interesting property of the current implementation is that you can use an Index across multiple IndexLists. That may or may not be what you want. There's a way to add a compile-time check to prevent this, but I haven't implemented it yet (https://github.com/steveklabnik/indexlist/issues/7)