I have an stl iterator resulting from a std::find() and wish to test whether it is the last element. One way to write this is as follows:
mine *match = some
If you do:
if(itr != Mine.end() && itr == --Mine.end())
It should be fine. Because if itr is not at the end then there must be at least 1 element in the container and so end must yield a value result when decremented.
But if you still don't like that, there are lots of ways to do something equivalent, as all the other answers show.
Here's another alternative:
if(itr != Mine.end() && std::distance(Mine.begin(), itr) == Mine.size()-1)