The code you posted has fixed the type of iterators returned from Base, and all of its implementations up to std::vector<int>::iterator, which are probably not what you want. Jeremiah's suggestion is one way to go with one drawback: you lose compatibility with STL ... I know three implementations of the polymorphic shell of the iterator:
- becker
any_iterator(which implements boost::iterator_facade) - library
opaque_iterator(google for her) or - Adobe , STL,
any_iterator s.
, ... , any_iterators (any_iterator<Derived> any_iterator<Base>), STL . #, Enumerator<T>, (*) ( imho , STL- ), "" STL.
(*) = "", : -)