I have no experience implementing iterators, although I think this is similar to other projects. Refactoring, common code, etc.
Looking at the GNU implementation of libstdc ++ std::vector::iterator
#include <bits/stl_iterator_base_funcs.h> // ... template ... class vector : ... { typedef __gnu_cxx::__normal_iterator<pointer, vector> iterator; typedef __gnu_cxx::__normal_iterator<const_pointer, vector> const_iterator; };
source share