Hacker News new | ask | show | jobs
by TwistedWave 4614 days ago
Having list iterators carry a field pointing to their container wouldn't help you determine the number of objects between two iterators when you splice, which is what you need in order to maintain the object count.

Storing an index in the iterator would not be a solution either. That would mean updating the index in all the existing iterators when you insert an object in the list.

1 comments

Of course. Thanks.