C++ Best way to check if an iterator is valid
I want to do something like this:
std::vector<int>::iterator it; // /cut/ search for something in vector and point iterator at it. if(!it) //check whether found do_something();
But there is no operator! for iterators. How can I check whether iterator points at anything?