ValueTuple<T1,T2,T3,T4,T5>.IStructuralComparable.CompareTo(Object, IComparer) ValueTuple<T1,T2,T3,T4,T5>.IStructuralComparable.CompareTo(Object, IComparer) ValueTuple<T1,T2,T3,T4,T5>.IStructuralComparable.CompareTo(Object, IComparer) Method

定義

使用指定的比較子來比較目前的 ValueTuple<T1,T2,T3,T4,T5> 執行個體與指定的物件,並傳回一個整數,指出目前的物件在排序次序中,是位於指定物件之前、之後或相同的位置。Compares the current ValueTuple<T1,T2,T3,T4,T5> instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object 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 Object Object

要與目前執行個體比較的物件。The object to compare with the current instance.

comparer
IComparer IComparer IComparer

提供自訂規則進行比較的物件。An object that provides custom rules for comparison.

傳回

帶正負號的整數,可指出此執行個體以及排序次序中 other 的相對位置,如下表所示。A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following table.

Value 描述Description
負整數A negative integer 這個執行個體位於 other 之前。This instance precedes other.
Zero 這個執行個體和 other 的排序位置相同。This instance and other have the same position in the sort order.
正整數A positive integer 這個執行個體位於 other 之後。This instance follows other.

實作

適用於