Problem with binary ==
<p>I've run into strange problem with binary <code>operator==</code>.<br>
I have a function which returns:
<code>Type&lt; Colors &gt;* get();</code>, <code>T</code> is of type <code>enum Colors {Red,Black}</code>
and I have an <code>operator==</code> defined as:  </p>

<pre><code>bool operator==(Type&lt;Colors&gt;* left, Colors right)
{
//...
}
</code></pre>

<p>Now, in code I have line:  </p>

<pre><code>if (get() == Red)
{
//
}
</code></pre>

<p>but here I'm getting error saying that:   </p>

<pre><code>error C2679: binary '==' : no operator found which takes a right-hand operand of type 'Colors' (or there is no acceptable conversion)
1&gt;          could be 'built-in C++ operator==(Node&lt;Key_T,Value_T&gt; *, Node&lt;Key_T,Value_T&gt; *)'
1&gt;          with
1&gt;          [
1&gt;              Key_T=int,
1&gt;              Value_T=int
1&gt;          ]

or       'bool operator ==(const Type&lt;T&gt; *,const Colors)'
1&gt;          with
1&gt;          [
1&gt;              T=Colors
1&gt;          ]
1&gt;          while trying to match the argument list '(Node&lt;Key_T,Value_T&gt; *, Colors)'
1&gt;          with
1&gt;          [
1&gt;              Key_T=int,
1&gt;              Value_T=int
1&gt;          ]
</code></pre>

<p>Obviously the second match is what I've intended to use and it's perfect match yet it doesn't want to ;) compile. What am I doing wrong?</p>
