Code for a basic random access iterator based on pointers?

后端 未结 3 1128
醉梦人生
醉梦人生 2020-12-28 20:35

I\'ve never implemented STL-like iterators and I try to understand how to implement a very basic thing based on pointers. Once I will have this class I will be able to modif

3条回答
  •  梦谈多话
    2020-12-28 21:01

    Have a look at how Boost do it, the iterators in boost/container/vector.hpp - vector_const_iterator and vector_iterator are reasonably easy to understand pointer based iterators.

提交回复
热议问题