Cast()

JsonMemoryMarshal::Cast(const ReadOnlySpan<TFrom>&) method

Casts a read-only span of one primitive type TFrom to another primitive type TTo.

template<typename TFrom,typename TTo> static ReadOnlySpan<TTo> System::Text::Json::JsonMemoryMarshal::Cast(const ReadOnlySpan<TFrom> &span)

Template parameters

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

Arguments

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

Return Value

A read-only span of the target type.

See Also