J
Jon Shemitz
Is there a way in 2.0 to say that a generic can not be applied to a
value type?
public class Unique<T> where T: new()
{
private static T cache = default(T);
public static T Instance
{ get
{
if (cache == null)
return cache = new T();
else
return cache;
} }
}
I want to be able to do Unique<someClass> but not Unique<int>.
value type?
public class Unique<T> where T: new()
{
private static T cache = default(T);
public static T Instance
{ get
{
if (cache == null)
return cache = new T();
else
return cache;
} }
}
I want to be able to do Unique<someClass> but not Unique<int>.