MemoryExtensions.Overlaps Method

Definition

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-6.0 net-6.0
Product Versions
net-6.0 net-6.0

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-6.0 net-6.0
Product Versions
net-6.0 net-6.0

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-6.0 net-6.0
Product Versions
net-6.0 net-6.0

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-6.0 net-6.0
Product Versions
net-6.0 net-6.0