I recently came across input iterators in STL, but couldn't find out any scenario in which they might be used? (E.g. output iterators can be used along with copy() function to print the container items to console or a file).
Since forward iterators are input iterators, if you have an algorithm that works as efficiently with input iterators as with forward iterators, then you might as well write it with input iterators in mind so that it would work with forward iterators too, even if it never actually gets used with input iterators that are not forward iterators.
For example, you could use input iterators to initialise a container, just as you could use the iterators from another container to initialise that container.
C + C++ Compiler: MinGW port of GCC
Build + Version Control System: SCons + Bazaar
Bookmarks