Suppose I have a list, in which no new nodes are added or deleted. However, the nodes may be shuffled around.
Is it safe to save an iterator, pointing to a node in the list, and access it at some arbitrarily later time?
Edit (followup question):
The documentation for list::splice() says that it removes elements from the argument list. Does this mean if I call splice, using the same list as arguments to the function, that existing iterators will be invalidated?
Yes,
std::listiterators are just pointers to a node. You can insert, delete (other nodes), and rearrange nodes in the list and the iterator is not invalidated.