Modifier

Partager via


SpanExtensions.DangerousGetReferenceAt<T>(Span<T>, Int32) Method

Definition

Returns a reference to an element at a specified index within a given Span<T>, with no bounds checks.

public static ref T DangerousGetReferenceAt<T> (this Span<T> span, int i);
static member DangerousGetReferenceAt : Span<'T> * int -> 'T
<Extension()>
Public Function DangerousGetReferenceAt(Of T) (span As Span(Of T), i As Integer) As T

Type Parameters

T

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

Parameters

span
Span<T>

The input Span<T> instance.

i
Int32

The index of the element to retrieve within span.

Returns

T

A reference to the element within span at the index specified by i.

Remarks

This method doesn't do any bounds checks, therefore it is responsibility of the caller to ensure the i parameter is valid.

Applies to