Modifier

Partager via


ArrayExtensions.AsSpan Method

Definition

Overloads

AsSpan<T>(T[,,])

Creates a new Span<T> over an input 3D T array.

AsSpan<T>(T[,])

Creates a new Span<T> over an input 2D T array.

AsSpan<T>(T[,,], Int32)

Creates a new instance of the Span<T> struct wrapping a layer in a 3D array.

AsSpan<T>(T[,,])

Creates a new Span<T> over an input 3D T array.

public static Span<T> AsSpan<T> (this T[,,]? array);
static member AsSpan : 'T[,,] -> Span<'T>
<Extension()>
Public Function AsSpan(Of T) (array As T(,,)) As Span(Of T)

Type Parameters

T

The type of elements in the input 3D T array instance.

Parameters

array
T[,,]

The input 3D T array instance.

Returns

Span<T>

A Span<T> instance with the values of array.

Applies to

AsSpan<T>(T[,])

Creates a new Span<T> over an input 2D T array.

public static Span<T> AsSpan<T> (this T[,]? array);
static member AsSpan : 'T[,] -> Span<'T>
<Extension()>
Public Function AsSpan(Of T) (array As T(,)) As Span(Of T)

Type Parameters

T

The type of elements in the input 2D T array instance.

Parameters

array
T[,]

The input 2D T array instance.

Returns

Span<T>

A Span<T> instance with the values of array.

Applies to

AsSpan<T>(T[,,], Int32)

Creates a new instance of the Span<T> struct wrapping a layer in a 3D array.

public static Span<T> AsSpan<T> (this T[,,] array, int depth);
static member AsSpan : 'T[,,] * int -> Span<'T>
<Extension()>
Public Function AsSpan(Of T) (array As T(,,), depth As Integer) As Span(Of T)

Type Parameters

T

The type of elements in the input 3D T array instance.

Parameters

array
T[,,]

The given 3D array to wrap.

depth
Int32

The target layer to map within array.

Returns

Span<T>

A Span<T> instance wrapping the target layer within array.

Exceptions

Thrown when array doesn't match T.

Thrown when depth is invalid.

Applies to