I have the following method with a generic type:
T GetValue<T>();
I would like to restrict T to primitive types such as int, string, float, but not class type. I know that I can define generic for a class type as follows:
C GetObject<C>() where C: class;
I'm not sure if this is possible for primitive types and how to do it.
David.Chu.ca Apr 30 '09 at 3:42 2009-04-30 03:42
source share