System::Runtime::InteropServices::MemoryMarshal::AsBytes method

MemoryMarshal::AsBytes method

Casts a Span of one primitive type T to Span of bytes.

template<typename T> static Span<uint8_t> System::Runtime::InteropServices::MemoryMarshal::AsBytes(const Span<T> &span)
ParameterDescription
TThe type of elements in the span.
ParameterTypeDescription
spanconst Span<T>&The span to cast.

ReturnValue

A span of bytes representing the same memory as the original span.

See Also