Dear Sirs, Dear Newsgroup, Imagine I have some function that only gives me an iterator to a vector, but not the vector itself.Unfortunately this vector can be empty and the iterator can point to 'non valid'.The concept of an iterator is fundamental to understanding the C Standard Template Library (STL) because iterators provide a means for accessing data stored in container classes such a vector, map, list, etc.You can think of an iterator as pointing to an item that is part of a larger container of items. This effectively reduces the container size by the number of elements removed, which are destroyed.Unlike other standard sequence containers, list and forward_list objects are specifically designed to be efficient inserting and removing elements in any position, even in the middle of the sequence.
For traversing the items stored in a container, you can use one of two types of iterators: Java-style iterators and STL-style iterators.
If you are unfamiliar with the STL, or prefer to do things the "Qt way", you can use these classes instead of the STL classes.
The container classes are implicitly shared, they are reentrant, and they are optimized for speed, low memory consumption, and minimal inline code expansion, resulting in smaller executables.
My thanks in advance, Marc Dear Sirs, Dear Newsgroup, Imagine I have some function that only gives me an iterator to a vector, but not the vector itself.
My thanks in advance, Marc I think this is a dreadful design and personally I would be in favour of "changing a lot of old code".