Nullable type as a generic parameter
<p>I'm trying to implement a class that stores a generic nullable type:</p>

<pre><code>public class myclass&lt;T?&gt;
{
    T? myvariable;

    public T? myfunction(){
        return myvariable;
    }
 }
</code></pre>

<p>And while the above class compiles just fine, the actual use that provides trouble:</p>

<pre><code>myclass&lt;int?&gt; c = new myclass&lt;int&gt;();
int? = c.myfunction();   // does not work: implicit cast from type T? in int? not possible.
// or, assuming the variable is not null
int = c.myfunction().Value; // implicit cast from type T in int not possible.
</code></pre>

<p>What am I doing wrong or how can I work around this?</p>
