Quote:Original post by johnnyBravo
I'm not sure I understand what the problem is, like what does that function have to do with .end() ?
It is not guaranteed that the value returned by actors.end() is modifiable. Therefore, it might happen that, if you change to another compiler, or use another container, an expression such as --actors.end() will cause a compiler error. Because of this, it is preferable to avoid it, and resort to other options which, though a little bit longer, are always safe to compile.
As a side note, your code here could very well be converted to:
for (ActorsIterator j = actors.begin(); j != actors.end(); ++j) for (ActorsIterator i = actors.begin(); i != j; ++i) // Do stuff with i, j
Aside from the order in which the (i,j) pairs are visited, this code should have the same result as yours, and not require any prior increment or decrement.