title: Do I have to return a reference to the object when overloading a pre-increment operator?
body: <p>Can I use:</p>
  
  <pre><code>MyClass&amp; MyClass::operator++ () {
      a++;  // private var of MyClass
      return (*this);
  }
  </code></pre>
  
  <p>Or it can be:</p>
  
  <pre><code>MyClass MyClass::operator++ ();
  </code></pre>
  
  <p>What's the difference?</p>
  
  <hr>
  
  <p><strong>Thanks for answers. I have another issue.</strong></p>
  
  <p>Many people do something like that:</p>
  
  <pre><code>MyClass&amp; MyClass::operator++();
  MyClass MyClass::operator++(int);
  </code></pre>
  
  <p>Isn't it illogical? Please give some examples if you can.</p>
  
  <p>I know that the first version is pre-increment and the second is post-increment, but i ask why the first one returns reference but the second one not? It is in the same code (class), and the same use of the code.</p>