Generic Usenet Account wrote:
This posting is just for clarification of my understanding. It appears
to me that only vector and deque iterators (i.e. random access
iterators) allow "iterator arithmetic" operations (like iter+2, iter-1
etc.). Kindly confirm.
Forward iterators support incrementing.
Bidirectional iterators support incrementing and decrementing.
Random access iterators support incrementing, decrementing, and the sort
of arithmetic that you've mentioned.
In the containers provided by the Standard C++ Library, the sequences
managed by vector and deque have random access iterators. The sequences
managed by list, set, multiset, map, and multimap have bidirectional
iterators.
In containers from other sources, check the documentation.
--
Pete Becker
Dinkumware, Ltd. (
http://www.dinkumware.com)