This seems to me a simple question but I can't find the answer.
Currently I use an iterator to search through a vector and test its elements. I access the elements using
std::vector<int>::iterator it;
if(*it==0);
Can I use the same pointer arithmetic style logic to also test the next element (without altering my iterator)?
I first need to see if it will push the iterator out of bounds
if(it!=myvec.end())
Then test both current element and next element
if(*it==1 && *(it+1)==1)
Will this work as I expect from using pointers?
Many thanks in advance for your help.