title: C# generic type constraint for everything nullable
body: <p>So I have this class:</p>
  
  <pre><code>public class Foo&lt;T&gt; where T : ???
  {
      private T item;
  
      public bool IsNull()
      {
          return item == null;
      }
  
  }
  </code></pre>
  
  <p>Now I am looking for a type constraint that allows me to use everything as type parameter that can be <code>null</code>. That means all reference types, as well as all the <code>Nullable</code> (<code>T?</code>) types:</p>
  
  <pre><code>Foo&lt;String&gt; ... = ...
  Foo&lt;int?&gt; ... = ...
  </code></pre>
  
  <p>should be possible.</p>
  
  <p>Using <code>class</code> as the type constraint only allows me to use the reference types.</p>
  
  <p><em>Additional Information:</em>
  I am writing a pipes and filters application, and want to use a <code>null</code> reference as the last item that passes into the pipeline, so that every filter can shut down nicely, do cleanup, etc...</p>