ArrayExtensions.AsSpan Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
AsSpan<T>(T[,,]) |
Creates a new Span<T> over an input 3D |
AsSpan<T>(T[,]) |
Creates a new Span<T> over an input 2D |
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
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
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
A Span<T> instance wrapping the target layer within array
.
Exceptions
Thrown when array
doesn't match T
.
Thrown when depth
is invalid.