title: Switching on scoped enum
body: <p>I am trying to switch on a scoped-enum with the type unsigned int:</p>
  
  <p>The enum is defined as:</p>
  
  <pre><code>const enum struct EnumType : unsigned int { SOME = 1, MORE = 6, HERE = 8 };
  </code></pre>
  
  <p>I receive a const unsigned int reference and I am trying to check that value against the enum values. </p>
  
  <pre><code>void func(const unsigned int &amp; num)
  {
      switch (num)
      {
      case EnumType::SOME:
          ....
          break;
      case EnumType::MORE:
          ....
          break;
  
      ....
  
      default:
          ....
      }
  }
  </code></pre>
  
  <p>This results in a syntax error: <code>Error: This constant expression has type "EnumType" instead of the required "unsigned int" type.</code></p>
  
  <p>Now, using a <code>static_cast</code> on each switch, such as:</p>
  
  <pre><code>case static_cast&lt;unsigned int&gt;(EnumType::SOME):
      ....
      break;
  case static_cast&lt;unsigned int&gt;(EnumType::MORE):
      ....
      break;
  </code></pre>
  
  <p>fixes the syntax error, although casting at each case statement doesn't seem like a good way to do this. Do I really need to cast at each case, or is there a better way? </p>