Yes, you need two different iterators that will be fully compatible with stdlib.
You can get most typedefs inherited from std::iterator , but that will not give you any help in the actual implementation.
The Boost.Iterator Facade is trying to simplify the definition of its own iterators, and the tutorial is very useful.
If you try to do this without helpers, you should think about which concept your iterator uses, and then look at the tables in Β§24 of the C ++ standard. They describe all the operations that you need to support and what is the intended semantics.
source share