in reply to Design thoughts: iterator invalidation
Given the wide variety of ways to use a hash, I'm not sure if it is even possible to cover 'most cases' instead of just the most common case.
My guess at a default case for inexperienced coders would be to iterate over the list of keys present at the start, and skip any that were prematurely deleted.
Personally, I don't think I'd trust the iterator after changing the hash, but I'd probably hope that it would iterate until there are zero keys in the hash that it has not yet returned.
I think a poll on the topic would be worthwhile.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Design thoughts: iterator invalidation
by BrowserUk (Patriarch) on Feb 21, 2015 at 14:11 UTC | |
by SuicideJunkie (Vicar) on Feb 24, 2015 at 17:49 UTC |