Is there a way to restrict a generic type to only an integral type?
In the example, if I have a method
T[] sort<T>(T[] data) where : T ... {}
what would I set as a limitation if I wanted the parameter to be a kind of integral type?
I tried looking at MSDN , however it does not seem to say anything about constraining and primitive types.
Thank you for your help.
source
share