ArrayExtensions.AsMemory 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
AsMemory<T>(T[,,]) |
Creates a new Memory<T> over an input 3D |
AsMemory<T>(T[,]) |
Creates a new Memory<T> over an input 2D |
AsMemory<T>(T[,,], Int32) |
Creates a new instance of the Memory<T> struct wrapping a layer in a 3D array. |
AsMemory<T>(T[,,])
Creates a new Memory<T> over an input 3D T
array.
public static Memory<T> AsMemory<T> (this T[,,]? array);
static member AsMemory : 'T[,,] -> Memory<'T>
<Extension()>
Public Function AsMemory(Of T) (array As T(,,)) As Memory(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 Memory<T> instance with the values of array
.
Applies to
AsMemory<T>(T[,])
Creates a new Memory<T> over an input 2D T
array.
public static Memory<T> AsMemory<T> (this T[,]? array);
static member AsMemory : 'T[,] -> Memory<'T>
<Extension()>
Public Function AsMemory(Of T) (array As T(,)) As Memory(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 Memory<T> instance with the values of array
.
Applies to
AsMemory<T>(T[,,], Int32)
Creates a new instance of the Memory<T> struct wrapping a layer in a 3D array.
public static Memory<T> AsMemory<T> (this T[,,] array, int depth);
static member AsMemory : 'T[,,] * int -> Memory<'T>
<Extension()>
Public Function AsMemory(Of T) (array As T(,,), depth As Integer) As Memory(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 Memory<T> instance wrapping the target layer within array
.
Exceptions
Thrown when array
doesn't match T
.
Thrown when depth
is invalid.