title: how to use overloading increment operator for a iterator
body: <p>I want to implement a generic map by a linked list. 
  I've been attempting to overload the ++ operator to move an iterator through a list but I have problem using the new operator.</p>
  
  <pre><code>template &lt;class KeyType, class ValueType, class CompareFunction = std::less&lt;KeyType&gt; &gt;
  class MtmMap {
      public:
          class Node{
              public:
                  const Pair*  data;
                  Node* next;
                  Node()
                      : data(NULL),next(NULL){}
                  Node(const Pair pair){
                      data=new Pair(pair);
                      data=&amp;pair;
                      next=NULL;
                  }
              };
              Node* iterator;
              // ...
  };
  </code></pre>
  
  <p>Here is the overloading:</p>
  
  <pre><code>Node* operator++(){
      iterator=iterator-&gt;next;
      return iterator;
  }
  </code></pre>
  
  <p>I want to use the ++ operator in another method in mtmMap: </p>
  
  <pre><code>void insert(const Pair pair){
   for(begin();iterator-&gt;next-&gt;data;this++){
   }
  </code></pre>
  
  <p>but I get these errors:</p>
  
  <p>"lvalue required as increment operand"</p>
  
  <p>"increment of read-only location"   </p>