title: Construction of a void Type?
body: <p>I was given a piece of code that uses <code>void()</code> as an argument. The code doesn't compile... obviously?</p>
  
  <p>Can we instantiate anything of type <code>void</code>? I believed the answer was no, with the exception of a <code>void*</code>. For example:</p>
  
  <ol>
  <li>Writing the function <code>void askVoid(void param) {}</code> errors:</li>
  </ol>
  
  <blockquote>
    <p>A parameter may not have <code>void</code> type</p>
  </blockquote>
  
  <ol start="2">
  <li>Writing the function <code>void askNaught() {}</code> and calling it with askNaught(void())` errors:</li>
  </ol>
  
  <blockquote>
    <p>error C2660: <code>takeNaught</code>: function does not take 1 arguments</p>
  </blockquote>
  
  <ol start="3">
  <li>Writing the templatized function <code>template &lt;typename T&gt; void takeGeneric(T param) {}</code> and calling it with <code>takeGeneric(void())</code> errors:</li>
  </ol>
  
  <blockquote>
    <p>error C2893: Failed to specialize function template <code>void takeGeneric(T)</code></p>
  </blockquote>
  
  <ol start="4">
  <li>Declaring <code>void voidType</code> errors:</li>
  </ol>
  
  <blockquote>
    <p>Incomplete type is not allowed</p>
  </blockquote>
  
  <ol start="5">
  <li>Declaring <code>auto autoVoid = void()</code> errors:</li>
  </ol>
  
  <blockquote>
    <p>Cannot deduce <code>auto</code> type</p>
  </blockquote>
  
  <ol start="6">
  <li>Declaring <code>void* voidPtr</code> works fine, but <code>remove_pointer_t&lt;decltype(voidPtr)&gt; decltypeVoid</code> errors:</li>
  </ol>
  
  <blockquote>
    <p>error C2182: <code>decltypeVoid</code>: illegal use of type <code>void</code></p>
  </blockquote>
  
  <p>That's it, right? There is no place for <code>void()</code> in C++ is there? This is just bad code I've been given, right?</p>