title: Why are arrays of references illegal?
body: <p>The following code does not compile.</p>
  
  <pre><code>int a = 1, b = 2, c = 3;
  int&amp; arr[] = {a,b,c,8};
  </code></pre>
  
  <p><strong>What does the C++ standard say about this?</strong></p>
  
  <p>I know I could declare a class that contains a reference, then create an array of that class, as shown below.  But I really want to know why the code above doesn't compile.</p>
  
  <pre><code>struct cintref
  {
      cintref(const int &amp; ref) : ref(ref) {}
      operator const int &amp;() { return ref; }
  private:
      const int &amp; ref;
      void operator=(const cintref &amp;);
  };
  
  int main() 
  {
    int a=1,b=2,c=3;
    //typedef const int &amp;  cintref;
    cintref arr[] = {a,b,c,8};
  }
  </code></pre>
  
  <p>It is possible to use <code>struct cintref</code> instead of <code>const int &amp;</code> to simulate an array of references.</p>