title: Reference initialization in C++
body: <p>Can anybody explain to me why there is a difference between these two statements?</p>
  
  <pre><code>class A{};
  
  const A&amp; a = A();         // correct 
  
  A&amp; b = A();               // wrong
  </code></pre>
  
  <p>It says 
  invalid initialization of non-const reference of type <code>A&amp;</code> from a temporary of type <code>A</code></p>
  
  <p>Why does <code>const</code> matter here?</p>