Hello,
I want to define a generic class which should accept only nullable
types or reference types.
What's the best way to costrain it?
---------
class MyClass<T>{
...
}
---------
T must be either nullable type or reference type.
int? is ok.
string is ok.
int is not ok.
Thanks in advance.
Sam
I want to define a generic class which should accept only nullable
types or reference types.
What's the best way to costrain it?
---------
class MyClass<T>{
...
}
---------
T must be either nullable type or reference type.
int? is ok.
string is ok.
int is not ok.
Thanks in advance.
Sam
Comment