title: How to check if a generic type parameter is nullable?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5181494/determine-if-a-generic-param-is-a-nullable-type">Determine if a generic param is a Nullable type</a>  </p>
  </blockquote>
  
  
  
  <p>I'm trying to determine if a type parameter is Nullable. </p>
  
  <pre><code>    public T Get&lt;T&gt;(int index)
      {
          var none=default(T);
          var t = typeof(T);
          BaseVariable v = this[index].Var;
          if (T is Nullable) //compiler error
          {
              if (v == ... )
              {
                  return none;
              }
          }
          //....
      }
  </code></pre>
  
  <p>How do I do this? I've tried doing <code>t == typeof(Nullable)</code> but that always resulted in false. </p>
  
  <p>What I want to happen is for <code>foo.Get&lt;bool?&gt;(1)</code> to null at times.</p>