MemoryExtensions.Cast<TFrom,TTo>(Memory<TFrom>) 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.
Casts a Memory<T> of one primitive type TFrom
to another primitive type TTo
.
public static Memory<TTo> Cast<TFrom,TTo> (this Memory<TFrom> memory) where TFrom : struct where TTo : struct;
static member Cast : Memory<'From (requires 'From : struct)> -> Memory<'o (requires 'o : struct)> (requires 'From : struct and 'o : struct)
<Extension()>
Public Function Cast(Of TFrom As Structure, TTo As Structure) (memory As Memory(Of TFrom)) As Memory(Of TTo)
Type Parameters
- TFrom
The type of items in the source Memory<T>.
- TTo
The type of items in the destination Memory<T>.
Parameters
Returns
Memory<TTo>
A Memory<T> of type TTo
Exceptions
Thrown when the data store of memory
is not supported.