Currently the only way to do this is to clone things -- because the index could be updated before the reference stops being used.
However it should be possible to make a non-cloning iterator where the returned value is self and one uses the index by reading self.index.
Currently the only way to do this is to clone things -- because the index could be updated before the reference stops being used. However it should be possible to make a non-cloning iterator where the returned value is
self
and one uses the index by readingself.index
.