Hi,
I know iterator categories as presented
by many authors: Stroustrup, Josuttis and Koenig&Moo:
Input <---|
|<--- Forward <--- Bidirectional <--- Random
Output <---|
Is it a requirement that Forward, Bidirectional and Random iterators
provide operations of both categories: Input and Output?
Here are my objectives:
1. I'd like to create custom iterator of Input
category - read-only access.
2. I'd also like to define my read-only access iterator to act as
bidirectional or random access (my sequence is random access compatible).
Last question, is it a valid and STL-compatible iterator which:
- enables user to travers both directions or even to get random access
- provides *only* read-only access?
Simply, it's a little cofusing me that i.e. Bidirectional iterator
is always assumed to provide read and write access but it is not assumed
to provide only read-only access.
Thanks for giving me some light on this subject.
Cheers
--
Mateusz Łoskot
http://mateusz.loskot.net