title: Why does changing what a reference points to not throw an error?
body: <p>Iv got to the stage in my c++ study concerning references. It states the following rule:</p>
  
  <p>Once a reference is initialized to an object, it cannot be changed to refer to another object.</p>
  
  <p>Iv wrote a short code (as asked to in an exercise) that is meant to prove this rule correct.</p>
  
  <pre><code>int y = 7;
  int z = 8;
  
  int&amp;r = y;
  r = z;
  </code></pre>
  
  <p>Can someone explain why this code compiles without any errors or warnings?</p>