How to implement an STL-style iterator and avoid common pitfalls?
问题 I made a collection for which I want to provide an STL-style, random-access iterator. I was searching around for an example implementation of an iterator but I didn\'t find any. I know about the need for const overloads of [] and * operators. What are the requirements for an iterator to be \"STL-style\" and what are some other pitfalls to avoid (if any)? Additional context: This is for a library and I don\'t want to introduce any dependency on it unless I really need to. I write my own