...
- Both iterators refer into the same container.
- The iterator representing the start of the range precedes the iterator representing the end of the range.
- The elements iterated over do not have unspecified values.
- The iterators are not invalidated, in conformance with CTR51-CPP. Use valid references, pointers, and iterators to reference elements of a container.
An empty iterator range (where the two iterators are valid and equivalent) is considered to be valid.
Accessing two iterators that do not refer into the same container or accessing invalidated iterators results in undefined behavior.
...