About Iterators in C ++

I read something from "More Effective C ++", paragraph 18:

In short, an iterator is an object, not a pointer, so there is no guarantee that "->" can be applied to it. STL really requires that "." and "*" are true for iterators, therefore (* it). the second, albeit syntactically clumsy, is guaranteed to work.)

I usually use ->iterators and there are no problems. Can someone give an example or explain it?

+4
source share
1 answer

" ++" - 20 ( 1996 ); , .

Standard ( 10 ) 2003 -> ( [lib.iterator.requirements]/1):

[...] i, (*i).m , i->m , (*i).m. [...]

(*i).m "" .

+11

All Articles