Addition: Because in it = list.end();
it gets => pointer [some block of memory] which is understood as "end" (or point where to stop, right or left boundary). So output its content (cout<<*it) you will see memory[block] address. If you declare and use as this:
std::list<...>::const_iterator it = list.begin();
std::list<...>::const_iterator iTail = list.end();
while(it!=iTail)
{
//do smthing
++it;
}
either loop will be skipped or you will get some garbage from heap. Its case of const_iterator (didn't read documentation but obviously for "write" protection).
In case of iterator std::list<...>::iterator
only .end()
points to the last[element] => [end]. In cases:
std::list<...>::const_reverse_iterator and std::list<...>::reverse_iterator
iterator shifted automatically to the first elem, depending on start => end
or end =>start
you are going to run through list.