Span<T>.Equality(Span<T>, Span<T>) Span<T>.Equality(Span<T>, Span<T>) Span<T>.Equality(Span<T>, Span<T>) Span<T>.Equality(Span<T>, Span<T>) Operator

定义

返回一个值,该值指示两个 Span<T> 对象是否相等。Returns a value that indicates whether two Span<T> objects are equal.

public:
 static bool operator ==(Span<T> left, Span<T> right);
public static bool operator == (Span<T> left, Span<T> right);
static member ( = ) : Span<'T> * Span<'T> -> bool
Public Shared Operator == (left As Span(Of T), right As Span(Of T)) As Boolean

参数

left
Span<T> Span<T> Span<T> Span<T>

要比较的第一个范围。The first span to compare.

right
Span<T> Span<T> Span<T> Span<T>

要比较的第二个范围。The second span to compare.

返回

如果两个 Span<T> 对象相等,则为 true;否则为 falsetrue if the two Span<T> objects are equal; otherwise, false.

注解

如果Span<T>两个对象具有相同的长度和对应的left元素,并且指向相同right的内存,则这两个对象相等。Two Span<T> objects are equal if they have the same length and the corresponding elements of left and right point to the same memory. 请注意,相等性测试会尝试确定内容是否相等。Note that the test for equality does not attempt to determine whether the contents are equal.

适用于