First of all, I have a question, why are you using pointers to store iterators instead of vector?
Now about your question, in c++ sometimes you can dereference an iterator like .end(), but it can cause undefined behavior, so it is not recommended, in your situation, the variable referencing to your .end() could've been initialized before, that's why you can dereference it