Boost logo

Boost Users :

From: Marshall Clow (marshall_at_[hidden])
Date: 2002-06-04 00:29:45

At 10:02 PM -0700 6/3/02, Duane Murphy wrote:
>I really love iterators. I have worked at trying to figure out the
>"right" way of doing a plain iterator. That is I have a "thing" that
>looks like a container and has APIs for "iterating" the container but
>those APIs dont really look like a standard iterator.
>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.

-- Marshall
Marshall Clow     Idio Software   <mailto:marshall_at_[hidden]>
My name is Bobba Fett. You killed my father, prepare to die!

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at