Llegeix en anglès Edita

Comparteix a través de


MemoryExtensions.Overlaps Method

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Overloads

Overlaps<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)

Determines whether two read-only sequences overlap in memory.

Overlaps<T>(Span<T>, ReadOnlySpan<T>)

Determines whether a span and a read-only span overlap in memory.

Overlaps<T>(ReadOnlySpan<T>, ReadOnlySpan<T>, Int32)

Determines whether two read-only sequences overlap in memory and outputs the element offset.

Overlaps<T>(Span<T>, ReadOnlySpan<T>, Int32)

Determines whether a span and a read-only span overlap in memory and outputs the element offset.

Overlaps<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Determines whether two read-only sequences overlap in memory.

public static bool Overlaps<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> other);

Type Parameters

T

The type of elements in the read-only sequence.

Parameters

span
ReadOnlySpan<T>

The first sequence.

other
ReadOnlySpan<T>

The second sequence.

Returns

true if the two sequences overlap; otherwise, false.

Applies to

.NET 10 i altres versions
Producte Versions
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.0 (package-provided), 2.1

Overlaps<T>(Span<T>, ReadOnlySpan<T>)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Determines whether a span and a read-only span overlap in memory.

[System.Runtime.CompilerServices.OverloadResolutionPriority(-1)]
public static bool Overlaps<T>(this Span<T> span, ReadOnlySpan<T> other);
public static bool Overlaps<T>(this Span<T> span, ReadOnlySpan<T> other);

Type Parameters

T

The type of elements in the span.

Parameters

span
Span<T>

The span to compare.

other
ReadOnlySpan<T>

The read-only span to compare.

Returns

true if the two sequences overlap; otherwise, false.

Attributes

Applies to

.NET 10 i altres versions
Producte Versions
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.0 (package-provided), 2.1

Overlaps<T>(ReadOnlySpan<T>, ReadOnlySpan<T>, Int32)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Determines whether two read-only sequences overlap in memory and outputs the element offset.

public static bool Overlaps<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> other, out int elementOffset);

Type Parameters

T

The type of elements in the span.

Parameters

span
ReadOnlySpan<T>

The first sequence.

other
ReadOnlySpan<T>

The second sequence.

elementOffset
Int32

When the method returns, contains the offset between span and other.

Returns

true if the two sequences overlap; otherwise, false.

Applies to

.NET 10 i altres versions
Producte Versions
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.0 (package-provided), 2.1

Overlaps<T>(Span<T>, ReadOnlySpan<T>, Int32)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Determines whether a span and a read-only span overlap in memory and outputs the element offset.

[System.Runtime.CompilerServices.OverloadResolutionPriority(-1)]
public static bool Overlaps<T>(this Span<T> span, ReadOnlySpan<T> other, out int elementOffset);
public static bool Overlaps<T>(this Span<T> span, ReadOnlySpan<T> other, out int elementOffset);

Type Parameters

T

The type of elements in the span.

Parameters

span
Span<T>

The first sequence to compare.

other
ReadOnlySpan<T>

The second sequence to compare.

elementOffset
Int32

When the method returns, contains the offset between span and other.

Returns

true if the two sequences overlap; otherwise, false.

Attributes

Applies to

.NET 10 i altres versions
Producte Versions
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.0 (package-provided), 2.1