title: Return value of operator++
body: <p>I have the following code that is broken. I can fix it by modifying certain line in code (see the comment). What is the cause of the problem?    </p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  class Number{
  public:
      int n;
      Number(int a):n(a){}
  
      //when I change the following to
      //friend Number&amp; operator++(Number&amp; source, int i)
      //then it compiles fine and correct value is printed
      friend Number operator++(Number&amp; source, int i){
          ++source.n;
          return source;
      }
  };
  
  int main() {
  
      Number x(5);
      x++++; //error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
      cout&lt;&lt;x.n;
  
      return 0;
  }
  </code></pre>