C++ invalid use of void, why? : <pre><code>char mem[8];
uint64_t *memory{(uint64_t*)(void*)&amp;mem[0]};
std::cout &lt;&lt; "diff: " &lt;&lt; (void*)memory - (void*)(&amp;mem[0]) &lt;&lt; std::endl;
</code></pre>

<p>Trivial example, error message with gcc is:</p>

<pre><code>error: invalid use of ‘void’
std::cout &lt;&lt; "diff: " &lt;&lt; (void*)memory - (void*)(&amp;mem[0]) &lt;&lt; std::endl;
</code></pre>
