title: C++ iterator and reverse iterator
body: <p>I'm writing an <code>iterator</code> (actually it is <code>const_iterator</code> for my current object, and I want also to create a <code>reverse_const_iterator</code> also.</p>
  
  <p>I looked around, to see how to do this and I stumbled across <a href="http://www.cplusplus.com/reference/iterator/reverse_iterator/" rel="noreferrer">this</a>:</p>
  
  <blockquote>
    <p>Notice however that when an iterator is reversed, the reversed version
    does not point to the same element in the range, but to the one
    preceding it. This is so, in order to arrange for the past-the-end
    element of a range: An iterator pointing to a past-the-end element in
    a range, when reversed, is changed to point to the last element (not
    past it) of the range (this would be the first element of the range if
    reversed). And if an iterator to the first element in a range is
    reversed, the reversed iterator points to the element before the first
    element (this would be the past-the-end element of the range if
    reversed).</p>
  </blockquote>
  
  <p>Is this what happens from the users' perspective, or when you dereference a <code>reverse_iterator</code> does it not abstract this away by giving you the value/reference of the object you <em>think</em> it is pointing to? Is this just implementation detail?</p>
  
  <p>My understanding was:</p>
  
  <pre><code>for(i = obj.rbegin(); i != obj.rend(); i++)
  </code></pre>
  
  <p>was equivalent to</p>
  
  <pre><code>for(i = obj.begin(); i != obj.end(); i++)
  </code></pre>
  
  <p>except in reverse. And so <code>*i</code> would go backward through the container in the first case, and go forward through the container in the second case. Is my instinct correct?</p>