I'm not saying you're keeping invalid iterator somewhere, but such issues are in principal quite hard to find and fix if they turn up, and they can turn up easily. Do you have a strong reason for keeping iterators rather than pointers (BTW, 'iterators' by design are just for iteration not for storing.)