C# allows you to define operators just like normal methods. However, these operators should not refer to themselves in their implementation. Doing so may result in unterminated recursive calls.
public static bool operator ==(Complex c1, Complex c2)
{
// We're implementing `==` for `Complex` class. However, the following binary
// expression uses `==` for comparing an instance of `Complex` class. This causes a recursive
// call.
if (c1 == ...)
{
// ...
}
}
public static bool operator ==(Complex c1, Complex c2)
{
// ...
// No more reference to operators such as `==` or `!=`.
if (c1.real == c2.real && ...)
{
// ...
}
}