{ return arg1 + arg2; }
public T Subtract(T arg1, T arg2)
{ return arg1 - arg2; }
public T Multiply(T arg1, T arg2)
{ return arg1 * arg2; }
public T Divide(T arg1, T arg2)
{ return arg1 / arg2; }
}
Alas, operator constraints are not supported under the current version of C#. If you were to
make
use of generic interface types, you could simulate the notion of
applying operators on type
parameters. You’ll see this approach in just a moment.
Do'stlaringiz bilan baham: