title: Restricting generic function to only work on Enums
body: <p>I have the following generic function:</p>
  
  <pre><code>public SomeType SomeFunction&lt;T&gt;(T value)
  {
  }
  </code></pre>
  
  <p>I would now like to restrict this generic function to work only with <code>Enum</code>s so I tried the following:</p>
  
  <pre><code>public SomeType SomeFunction&lt;T&gt;(T value) where T : System.Enum
  {
  }
  </code></pre>
  
  <p>But this resulted in:</p>
  
  <blockquote>
    <p>error CS0702: Constraint cannot be
    special class 'System.Enum'</p>
  </blockquote>
  
  <p>Is there a work around and out of curiosity does anyone know the reason why this type of constraint isn't allowed?</p>