Stateless iterator (source code)

= Stateless iterator

An <iterator> whose future observable <sequence> can be produced without changing cursor state. An infinite constant <sequence> is an example: removing its first element leaves the same <sequence>. A permanently empty <iterator> is another. Such cases show why an <iterator> interface does not logically force every implementing object to be mutable, although ordinary finite nonempty traversals need progress state somewhere.