title: Why is it impossible to have a reference-to-void?
body: <p>Why is it impossible to have a reference to void? The only thing I found in the C++ Standard is this line, at <strong>8.3.2.1</strong></p>
  
  <blockquote>
    <p>A declarator that specifies the type "reference to <em>cv</em> void" is ill-formed.</p>
  </blockquote>
  
  <p>Why is it that way? Why can't I write a "generic" function that accept a <code>void&amp;</code>? </p>
  
  <p>Just to be clear, I have no useful application in mind where using a reference-to-void could be better than using templates, but I'm just curious about the rationale for forbidding this construct.</p>
  
  <hr>
  
  <p>To clarify a little, I understand that using a reference-to-void "as is" would be as meaningless as dereferencing a pointer-to-void. However, I could cast it to a reference-to-<em>sometype</em> in order to use it, couldn't I? In fact, I don't see why the following snippet can work...</p>
  
  <pre><code>void foo(void *data)
  {
      int *i = reinterpret_cast&lt;int*&gt;(data);
      // do something with i
  }
  </code></pre>
  
  <p>...while this one cannot:</p>
  
  <pre><code>void foo(void &amp;data)
  {
      int &amp;i = reinterpret_cast&lt;int&amp;&gt;(data);
      // do something with i
  }
  </code></pre>