C
cpnet
There is probably an easy answer to this, but I haven't been able to find
it. I'm defining a method with 2 generic parameters like
void MyMethod<T>(T i1, T i2)
I want to be able to use the + operator in the body of my method:
T i3 = i1 + i2;
I can't figure out how to do this. I assume I need to add a constraint to
my method definition, but I can't figure out what contstraint I need to add.
it. I'm defining a method with 2 generic parameters like
void MyMethod<T>(T i1, T i2)
I want to be able to use the + operator in the body of my method:
T i3 = i1 + i2;
I can't figure out how to do this. I assume I need to add a constraint to
my method definition, but I can't figure out what contstraint I need to add.