End iterator invalidation

This excellent SO answer explains all the iterator invalidation rules:
http://stackoverflow.com/a/6442829/1959975
However it specifically says that it is not clear whether end iterators have the same rules applied.

libc++: http://coliru.stacked-crooked.com/a/78ad9bdb20f17e35 (thanks JLBorges)
libstdc++: http://coliru.stacked-crooked.com/a/38a59c57e98af174
They're both the same, as the SO post suggested they would be - that is, both implementations consider end iterators to indeed be affected by those rules (and both consider default-constructed iterators to be unrelated to end iterators).

Is there anything about it in any defect reports or is there any discussion amongst the standards committee? I have heard of globalized end iterators (that is, end iterators that mark the end of all containers and are not associated with any specific container), and I have also heard rumors about container-aware iterators. Anyone happen to know the latest news?
Last edited on
Topic archived. No new replies allowed.