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
Why do you need to do special behavior only if the item is the last one?
What about this. The plan is just to compare the address of the iterator's item with the address of the last item in the container, with a check to make sure the item is actually not already the end (making the back
call safe):
if (itr != Mine.end() && &*itr == &Mine.back()) {
doSomething;
}