title: Why can a C++ iterator be dereferenced although it isn't a pointer?
body: <p>I'm reading C++ Primer 5th, and I encounter code that looks like this:</p>
  
  <pre><code>    string s("some string");
      if (s.begin() != s.end())
      {
        auto it = s.begin();   
        *it = toupper(*it);
      }
  </code></pre>
  
  <p><code>it</code> receives a value from the iterator to the first character in string <code>s</code>; it is then changed to upper case by <code>toupper()</code>. How is it that <code>it</code> can be dereferenced? Shouldn't it just be a char type variable and not a pointer?</p>