Quote:Original post by 51mon
When I refer to elements outside the domain of an iterator, for example itrForward+1 when itrForward == vecExample.end(), the application automatically prone and I got error messages. This is a good feature most of the time but I would like to turn that off, can I do that somehow?
There are two different aspects here. The error messages are a feature of your implementation of the SC++L that you might be able to turn off. However, the fact that the application stops, crashes, or misbehaves, is a consequence of the standard, which makes incrementing iterators past the end result in undefined behavior.
So, even if you did manage to remove the helpful error messages, your code would still be prone to crashes (only they would happen at random or do more insidious things, like memory corruption).
In short, don't iterate past the end of containers.