title: Passing integers as constant references versus copying
body: <p>This might be a stupid question, but I notice that in a good number of APIs, a lot of method signatures that take integer parameters that aren't intended to be modified look like:</p>
  
  <p><code>void method(int x);</code></p>
  
  <p>rather than:</p>
  
  <p><code>void method(const int &amp;x);</code></p>
  
  <p>To me, it looks like both of these would <em>function</em> exactly the same. (EDIT: apparently not in some cases, see answer by R Samuel Klatchko) In the former, the value is copied and thus can't change the original. In the latter, a constant reference is passed, so the original can't be changed.</p>
  
  <p>What I want to know is why one over the other - is it because the performance is basically the same or even better with the former? e.g. passing a 16-bit value or 32-bit value rather than a 32-bit or 64-bit address? This was the only logical reason I could think of, I just want to know if this is correct, and if not, why and when one should prefer <code>int x</code> over <code>const int &amp;x</code> and vice versa.</p>