How do I fix "invalid type argument of 'unary'?
<p>I've been running into this compiler error:</p>

<blockquote>
  <p>invalid type argument of 'unary'</p>
</blockquote>

<p>I did some research on what "unary" was and got operators such as <code>+,-.&amp;</code>, so my guess is that I did a wrong operator somewhere. I'm only including the part of the code that has the error as the entire code is about 2000 lines long. Also there are other error's within the code, but they are the same so I assume if I can get an understanding of what is wrong with this one I should be able to figure out those.</p>

<pre><code>static int cmp_bk( const void *ap, const void *bp)
{
    int a; 
    int b;
    dynamic_cast&lt;const struct bk&gt;(*a)=ap;
    dynamic_cast&lt;const struct bk&gt;(*b)=bp;

    if (a-&gt;hash &lt; b-&gt;hash) return -1;
    if (a-&gt;hash &gt; b-&gt;hash) return 1;
    return (int)a-&gt;bk - (int)b-&gt;bk;
}
</code></pre>

<p>The exact error I get is:</p>

<blockquote>
  <p>invalid type argument of 'unary *'</p>
</blockquote>

<p>and it's set to both the lines</p>

<pre><code>dynamic_cast&lt;const struct bk&gt;(*a)=ap;
dynamic_cast&lt;const struct bk&gt;(*b)=bp;
</code></pre>
