I am writing a generic method for addition of integers, float, double
public T Swap<T>( T value1, T value2)
{
T temp;
temp = value1 +value2;
return temp;
}
I am getting an error:
Operator '+' cannot be applied to operands of type 'T' and 'T'
I am using VS 2005, can anyone tell me how to achive it?