title: Generic constraint to match numeric types
body: <p>I'm trying to write an extension method on numeric types to be used in a fluent testing framework I'm building. Basically, I want to do this:</p>
  
  <pre><code>public static ShouldBeGreaterThan&lt;T&gt;(this T actual, T expected, string message)
      where T : int || T: double || etc...
  </code></pre>
  
  <p>Just <code>where T : struct</code> doesn't do, since that will also match <code>string</code> and <code>bool</code>, and possibly something else I'm forgetting. is there something I can do to match only numeric types? (Specifically types that implement the <code>&gt;</code> and <code>&lt;</code> operators, so I can compare them... If this means I'm matching dates as well, it doesn't really matter - the extension will still do what I expect.)</p>