比较
用于实现两个对象的比较逻辑,可以自定义对象的比较规则。
1 | // \runtime\src\libraries\System.Private.CoreLib\src\System\Collections\IComparer.cs |
对应的泛型接口:
1 | // \runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\IComparer.cs |
基于比较器比较:
1 | // \runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\IStructuralComparable.cs |