title: Increment operator on reference variable
body: <p>Why does pre-increment work but post-increment does not on a reference variable?</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  void swap(int&amp;, int&amp;);
  
  int main()
  {
      int x=10, y=20;
      int &amp;a=x, &amp;b=y;
      swap(++a, ++b);  //swap (a++,b++) is not allowed.
      printf("%d %d ", a, b);
      return 0;
  }
  
  void swap(int&amp; x, int&amp; y)
  {
      x+=2;
      y+=3;
  } 
  </code></pre>
  
  <p>Why is <code>swap(++a, ++b)</code> allowed but <code>swap(a++, b++)</code> says:</p>
  
  <blockquote>
    <p>[Error] invalid initialization of non-const reference of type 'int&amp;' from an rvalue of type 'int'</p>
  </blockquote>