Edytuj

Udostępnij za pośrednictwem


SpanExtensions.DangerousGetReference<T>(Span<T>) Method

Definition

Returns a reference to the first element within a given Span<T>, with no bounds checks.

public static ref T DangerousGetReference<T> (this Span<T> span);
static member DangerousGetReference : Span<'T> -> 'T
<Extension()>
Public Function DangerousGetReference(Of T) (span As Span(Of T)) As T

Type Parameters

T

The type of elements in the input Span<T> instance.

Parameters

span
Span<T>

The input Span<T> instance.

Returns

T

A reference to the first element within span.

Remarks

This method doesn't do any bounds checks, therefore it is responsibility of the caller to perform checks in case the returned value is dereferenced.

Applies to