AsMemory()

MemoryMarshal::AsMemory(const ReadOnlyMemory<T>&) method

Casts a ReadOnlyMemory to mutable Memory.

template<typename T> static Memory<T> System::Runtime::InteropServices::MemoryMarshal::AsMemory(const ReadOnlyMemory<T> &memory)

Template parameters

ParameterDescription
TThe type of elements in the ReadOnlyMemory.

Arguments

ParameterTypeDescription
memoryconst ReadOnlyMemory<T>&The ReadOnlyMemory to cast.

Return Value

A Memory object that represents the same memory as the ReadOnlyMemory.

See Also