IComparable<> 作为通用约束有何特别之处

What is so special about IComparable<> as a Generic Constraint

假设我有一个 class

Class Apple<T> where T: IComparable<int>{}

现在,在为 Apple 创建对象时,我会这样做

Apple<int> obj = new Apple<int>();

上面的代码可以工作。

如果我用 IComparer<>IEnumerable<> 等任何其他通用接口替换相同的代码。像上面这样的对象创建将不起作用,我们必须像 [=16= 那样声明它]

Apple<IEnumerable<int>> obj = new Apple<IEnumerable<int>>();

为什么会这样?为什么我为 IComparable<> 声明的方式只适用于它而不适用于任何其他接口?

IComparable<T>, but about T itself, which - in case of int- also implements IComparable<int> 没什么特别的。但是 int 肯定不会实现 IEnumerable<int>.

或者换句话说:您当然可以 将每个 int 与另一个 int 进行比较。然而你不能迭代一个int