ReadOnlyMemory

ReadOnlyMemory class

Represents a read-only memory segment backed by an array.

template<typename T>class ReadOnlyMemory : public System::Details::MemoryCore<T>

Methods

MethodDescription
static ReadOnlyMemory get_Empty()Gets an empty ReadOnlyMemory instance.
ReadOnlySpan<T> get_Span() constGets a read-only span that represents the current memory.
ReadOnlyMemory Slice(int32_t, int32_t) constCreates a slice of the current readonly memory.
static ReadOnlyMemory to_ReadOnlyMemory(const ArrayPtr<T>&)Creates a ReadOnlyMemory instance from the specified array.
std::enable_if<std::is_same<T1, char16_t>::value, String>::type ToString() constConverts the character read-only memory to a string representation.
std::enable_if<!std::is_same<T1, char16_t>::value, String>::type ToString() constConverts the ordinary read-only memory to a string representation.

Remarks

Exposes a read-only span over the array region and supports slicing.

See Also