Edytuj

Udostępnij za pośrednictwem


ReadOnlySpanExtensions.DangerousGetReferenceAt<T> Method

Definition

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

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

Type Parameters

T

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

Parameters

span
ReadOnlySpan<T>

The input ReadOnlySpan<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