ImmutableArray<T>.IStructuralComparable.CompareTo(Object, IComparer) 方法

定义

确定当前集合元素在排序顺序中的位置是位于另一个元素之前、之后还是与其位置相同。Determines whether the current collection element precedes, occurs in the same position as, or follows another element in the sort order.

 virtual int System.Collections.IStructuralComparable.CompareTo(System::Object ^ other, System::Collections::IComparer ^ comparer) = System::Collections::IStructuralComparable::CompareTo;
int IStructuralComparable.CompareTo (object other, System.Collections.IComparer comparer);
Function CompareTo (other As Object, comparer As IComparer) As Integer Implements IStructuralComparable.CompareTo

参数

other
Object

要与当前实例进行比较的元素。The element to compare with the current instance.

comparer
IComparer

用于将当前数组的成员与另一个数组的对应成员进行比较的对象。The object used to compare members of the current array with the corresponding members of other array.

返回

一个整数,指示当前元素是位于另一个元素之前、之后还是与其位置相同。An integer that indicates whether the current element precedes, is in the same position or follows the other element.

实现

异常

该数组的长度不同。The arrays are not the same length.

注解

此成员是显式接口成员的实现。This member is an explicit interface member implementation. 它只能在 ImmutableArray<T> 实例被强制转换为 IStructuralComparable 接口时使用。It can be used only when the ImmutableArray<T> instance is cast to an IStructuralComparable interface.

适用于