ValueTuple<T1,T2>.Equals 方法

定义

返回一个值,该值指示当前 ValueTuple<T1,T2> 实例是否与指定的对象相等。Returns a value that indicates whether the current ValueTuple<T1,T2> instance is equal to a specified object.

重载

Equals(Object)

返回一个值,该值指示当前 ValueTuple<T1,T2> 实例是否与指定的对象相等。Returns a value that indicates whether the current ValueTuple<T1,T2> instance is equal to a specified object.

Equals(ValueTuple<T1,T2>)

返回一个值,该值指示当前 ValueTuple<T1,T2> 实例是否与指定的 ValueTuple<T1,T2> 实例相等。Returns a value that indicates whether the current ValueTuple<T1,T2> instance is equal to a specified ValueTuple<T1,T2> instance.

Equals(Object)

返回一个值,该值指示当前 ValueTuple<T1,T2> 实例是否与指定的对象相等。Returns a value that indicates whether the current ValueTuple<T1,T2> instance is equal to a specified object.

public:
 override bool Equals(System::Object ^ obj);
public override bool Equals (object obj);
override this.Equals : obj -> bool
Public Overrides Function Equals (obj As Object) As Boolean

参数

obj
Object

与该实例进行比较的对象。The object to compare with this instance.

返回

如果当前实例等于指定对象,则为 true;否则为 falsetrue if the current instance is equal to the specified object; otherwise, false.

注解

obj下列条件下, 参数被视为等于当前实例:The obj argument is considered to be equal to the current instance under the following conditions:

  • 它是ValueTuple<T1,T2>值类型。It is a ValueTuple<T1,T2> value type.

  • 其组件的类型与当前实例的组件相同。Its components are of the same types as those of the current instance.

  • 其组件等于当前实例的组件。Its components are equal to those of the current instance. 相等性取决于每个组件的默认相等比较器。Equality is determined by the default equality comparer for each component.

Equals(ValueTuple<T1,T2>)

返回一个值,该值指示当前 ValueTuple<T1,T2> 实例是否与指定的 ValueTuple<T1,T2> 实例相等。Returns a value that indicates whether the current ValueTuple<T1,T2> instance is equal to a specified ValueTuple<T1,T2> instance.

public:
 virtual bool Equals(ValueTuple<T1, T2> other);
public bool Equals (ValueTuple<T1,T2> other);
override this.Equals : ValueTuple<'T1, 'T2> -> bool
Public Function Equals (other As ValueTuple(Of T1, T2)) As Boolean

参数

other
ValueTuple<T1,T2>

要与此实例进行比较的值元组。The value tuple to compare with this instance.

返回

如果当前实例等于指定元组,则为 true;否则为 falsetrue if the current instance is equal to the specified tuple; otherwise, false.

实现

注解

other下列条件下, 参数被视为等于当前实例:The other argument is considered to be equal to the current instance under the following conditions:

  • 其组件的类型与当前实例的组件相同。Its components are of the same types as those of the current instance.

  • 其组件等于当前实例的组件。Its components are equal to those of the current instance. 相等性取决于每个组件的默认相等比较器。Equality is determined by the default equality comparer for each component.

适用于