I have following code:
public class Foo
{
public static bool operator<(Foo l, Foo f)
{
Console.WriteLine("Foo!");
return false;
}
//public static bool operator>(Foo l, Foo f)
//{
// return f < l;
//}
}
Compiler tells about error with message:
The operator 'Program.Foo.operator <(Program.Foo, Program.Foo)' requires a matching operator '>' to also be defined
It seems very weird for me. Why should I overload operator>
?