title: Detecting even and odd C++ vector iterators
body: <p>I searched and I'm surprised this hasn't been asked yet. I know how to do it with a simple loop, how about with vector iterators?</p>
  
  <pre><code>for( std::vector&lt;int&gt;::iterator it = somevector.begin(); it != somevector.end(); ++it )
  {
      //Conditions stating a certain vector has an even or odd index.
  }
  </code></pre>
  
  <p>Sorry for not clarifying, I meant detecting whether the index of a vector is odd or even.</p>