Is there any way to check if an iterator (whether it is from a vector, a list, a deque...) is (still) dereferencable, i.e. has not been invalidated?
I have been usi
if (iterator != container.end()) { iterator is dereferencable ! }
If your iterator doesnt equal container.end(), and is not dereferencable, youre doing something wrong.
container.end()