Bit byte wrote:
whats the difference - apart from what the name suggests? - i.e. one is
const
What are there pros and cons of using one over the other ?
Hi,
const_iteratoer means that within the iterator the container is const and
all of its elements are const. With a const_iterator you can neither modify
the container(add/remove elements) nor can you modify the elements in that
container. The advantage of the const_iterator is that the compiler
produces faster code when you use it. So you should use the const_iterator
whenever you iterate over the container without modifying anything.
Regards
Thorsten