Cast()

MemoryMarshal::Cast(const Span<TFrom>&) method

Casts a Span of one primitive type TFrom to another primitive type TTo.

template<typename TFrom,typename TTo> static Span<TTo> System::Runtime::InteropServices::MemoryMarshal::Cast(const Span<TFrom> &span)

Template parameters

ParameterDescription
TFromThe source type of the span.
TToThe target type of the span.

Arguments

ParameterTypeDescription
spanconst Span<TFrom>&The span to cast.

Return Value

A span of the target type.

See Also