Why doesn't remove_reference work on functions? : <p>Ran into something strange when doing some template metaprogramming the other day. It basically comes down to this assertion not (as I would expect) passing.   </p>

<pre><code>static_assert(std::is_same_v&lt;void(), std::remove_reference_t&lt;void()&amp;&gt;&gt;);
</code></pre>

<p>At first I thought I was making a syntactic mistake defining a function reference, but this assertion passes, showing that's not the case.</p>

<pre><code>static_assert(std::is_same_v&lt;void()&amp;, void()&amp;&gt;);
</code></pre>

<p>I also tried implementing <code>remove_reference</code> myself copying the source from cppreference but that didn't work either. What is going on here?</p>
