So I have a class which looks something like this:
public class Foo<TKey>
{
   // ...
}
I have a method which uses the generic argument TKey as follows:
public int Test(TKey val)
{
   return val | 5;
}
I need to set constraints which ensure that TKey is a numeric value in order to use bitwise operators. Anyhow, you can not set constraints to ensure that it is a numeric value since short, int, double, ... do not implement an interface like INumeric.
Now the question is, would this be possible with only constraints?
 
     
     
    