6

In the New Iterator Concepts standard proposal, I am not able to decipher any useful difference between a Single Pass Iterator and a Forward Traversal Iterator.

Does the "Assertion/Note" for the "++r" row in the Forward Traversal table imply that Forward Traversal Iterators are copyable, whereas Single Pass Iterators are not?

Additionally, why does the additional ability to default-construct make an iterator model Forward Traversal? What's the rationale?

Mukul M.
  • 540
  • 1
  • 5
  • 15
  • Not sure if duplicate, but it seems close, *very* close: [What's the difference between input iterators and read-only forward iterators?](http://stackoverflow.com/q/8869104/500104) – Xeo Feb 23 '12 at 13:06
  • Thanks for the link, @Xeo. For the sake of clarity, I would appreciate an explicit assertion that your answer to that question applies to the new iterator concepts as well, since the translation from old to new is not strictly one-to-one. Can you confirm that it applies? – Mukul M. Feb 24 '12 at 06:33

1 Answers1

5

The idea of the Single Pass Iterator is that it has less requirements than a Forward Traversal iterator. That makes it possible to create one for some cases where multi pass just isn't possible.

Think console input. Even if you could make a copy of the iterator, that wouldn't help you retrieve old keyboard input.

Bo Persson
  • 90,663
  • 31
  • 146
  • 203