title: Operator overloading enum class
body: <p>I'm trying to overload the <code>&amp;</code> operator of an enum class, but I'm getting this compiler error: error: no match for 'operator&amp;=' (operand types are 'int' and 'Numbers'). Any ideas about this?</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  enum class Numbers : int
  {
      zero                    = 0, 
      one                     = 0x01,
      two                     = 0x02
  };
  
  inline int operator &amp;(int a, Numbers b)
  {
      return ((a) &amp; static_cast&lt;int&gt;(b));
  }
  
  int main() {
      int a=1;
      a&amp;=Numbers::one;
      cout &lt;&lt; a ;
      return 0;
  }
  </code></pre>