Editar

Compartilhar via


SpanExtensions.DangerousGetReferenceAt Method

Definition

Overloads

DangerousGetReferenceAt<T>(Span<T>, Int32)

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

DangerousGetReferenceAt<T>(Span<T>, IntPtr)

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

DangerousGetReferenceAt<T>(Span<T>, Int32)

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

DangerousGetReferenceAt<T>(Span<T>, IntPtr)

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, nint i);
static member DangerousGetReferenceAt : Span<'T> * nativeint -> 'T
<Extension()>
Public Function DangerousGetReferenceAt(Of T) (span As Span(Of T), i As IntPtr) 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
IntPtr

nint

nativeint

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