C++ references and modification : <p>Lets say I have</p>

<pre><code>void swap(int &amp;x, int &amp;y){
  //do swap here
 }
</code></pre>

<p>Why is it legal to do: <code>x = y</code> inside of the function so that <strong>it assigns the VALUE of</strong> <code>y</code> to <code>x</code>?</p>

<p>Why isn't some sort of dereferencing needed?</p>
