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