Analysis of information sources in references of the Wikipedia article "迭代器" in Chinese language version.
An internal iterator is implemented by the member functions of the class which has the iteration logic. An external iterator is implemented by a separate class which can be attached to the object which has iteration logic. The advantage of external iterator is that, many iterators can be made active simultaneously on the existing or same object.
You can think of an iterator as pointing to an item that is part of a larger container of items.
A user-defined iterator usually takes the form of a code reference that, when executed, calculates the next item in a list and returns it. When the iterator reaches the end of the list, it returns an agreed-upon value.
•The iterator types iterator and const_iterator are of the forward iterator category
Iterators were introduced as constructs to allow looping over abstract data structures without revealing their internal representation.
Some authors use the term iterator, and others the term generator. Some make subtle distinctions between the two.
A user-defined iterator usually takes the form of a code reference that, when executed, calculates the next item in a list and returns it. When the iterator reaches the end of the list, it returns an agreed-upon value.
Iterators were introduced as constructs to allow looping over abstract data structures without revealing their internal representation.
You can think of an iterator as pointing to an item that is part of a larger container of items.
An internal iterator is implemented by the member functions of the class which has the iteration logic. An external iterator is implemented by a separate class which can be attached to the object which has iteration logic. The advantage of external iterator is that, many iterators can be made active simultaneously on the existing or same object.
Some authors use the term iterator, and others the term generator. Some make subtle distinctions between the two.
•The iterator types iterator and const_iterator are of the forward iterator category