title: How can I make operator++ proceed to the next node pointer in a linked list?
body: <p>I've got a linked list where I save data, and a pointer to next node, <code>Node&lt;T&gt;* next</code>, like this:</p>
  
  <pre><code>template &lt;class T&gt;
  struct Node
  {
      T data;
      Node&lt;T&gt;* next;
  };
  </code></pre>
  
  <p>The thing is I want to put in this a post-increment operator, so it returns the previous value of my node, but increment the reference. So if I do this</p>
  
  <pre><code>Node&lt;int&gt;* someNode = someList.SomeNode();
  Node&lt;int&gt;* tmp = someNode++; 
  </code></pre>
  
  <p><code>tmp</code> would be the original <code>someNode</code> value, but <code>someNode</code> would be <code>someNode-&gt;next</code>.</p>
  
  <p>is it possible to put an operator in the struct? I've tried to, and searched how to do it, but as I don't deal with operators I don't know how to do.</p>