"Marshall Clow"
At 10:02 PM -0700 6/3/02, Duane Murphy wrote:
The canonical example is a file iterator; iterate over the files in a directory. The directory appears to be a container with filenames as the members of the container.
I have gone back to this example several times in the last few years.
I have finally decided that this is a bad idea, because a file system directory is not really a container. The container can be changed outside the currently executing program, and there is no "container-like" semantics to tell the program that the iterators into that container are invalid.
?? Except in some implementations' debug mode, none of the standard containers tell the program when their iterators become invalid either.