title: Overloading operator->
body: <p>The code is about overloading <code>-&gt;</code> operator to let iterator's current point points to the dataobject (data below).</p>
  
  <pre><code>dataType* operator -&gt; () const {
      if (current == NULL) {
          throw std::invalid_argument(
              "Attempting to dereference NULL in dlistIterator");
      }
      return &amp;(current-&gt;data);
  }
  
  
  int main()
  {
      dlist&lt;myData&gt; myList;
      dlistIterator&lt;myData&gt; itr;
      for (itr = myList.begin(); itr != myList.end(); itr++)
      {
          itr-&gt;printData();
      }
  }
  </code></pre>
  
  <p>If I create a <code>myData</code> object lets say <code>abc</code>, <code>itr-&gt;printData();</code>, is like 
  <code>&amp;abcprintData()</code>? It really confuses me a lot.</p>