Why are the comparison operators not automatically overloaded with IComparable?
问题 When a class is IComparable , then we know everything to overload the < , > and == operators due to the CompareTo functionality, right? Then why aren't these overloaded automatically? Take a look at the example below: public class MyComparable : IComparable<MyComparable> { public int Value { get; } public MyComparable(int value) { Value = value; } public int CompareTo(MyComparable other) => Value.CompareTo(other.Value); } I was wondering why something like this wouldn't work by default: