title: Is this an example of reference reassignment? C++11
body: <p>As I understand it, one cannot change the reference variable once it has been initialized. See, for instance, <a href="https://stackoverflow.com/questions/57483/what-are-the-differences-between-a-pointer-variable-and-a-reference-variable-in">this question</a>. However, here is a minmal working example which sort of does reassign it. What am I misunderstanding? Why does the example print both 42 and 43?</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  class T {
      int x;
  public:
      T(int xx) : x(xx) {}
  
      friend std::ostream &amp;operator&lt;&lt;(std::ostream &amp;dst, T &amp;t) {
          dst &lt;&lt; t.x;
  
          return dst;
      }
  };
  
  int main() {
      auto t = T(42);
      auto q = T(43);
      auto &amp;ref = t;
      std::cerr &lt;&lt; ref &lt;&lt; std::endl;
      ref = q;
      std::cerr &lt;&lt; ref &lt;&lt; std::endl;
      return 0;
  }
  </code></pre>