When declaring a binary operator, at least one of the operand types must be the containing type. This sounds a good design decision in general. However, I didn't expect the following code to cause this error:
public class Exp<T>
{
public static Exp<int> operator +(Exp<int> first, Exp<int> second)
{
return null;
}
}
What is the problem with this operator? Why this case falls into operator overloading restrictions of c#? is it dangerous to allow this kind of declaration?