Memory

Memory class

Represents a mutable memory segment backed by an array.

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

Methods

MethodDescription
void CopyTo(const Memory&)Copies the contents of this memory to the destination memory.
static Memory get_Empty()Gets an empty Memory instance.
Span<T> get_Span() constGets a span that represents the current memory.
operator ReadOnlyMemory< T >() constImplicitly converts Memory to ReadOnlyMemory.
Memory Slice(int32_t, int32_t) constCreates a slice of the current memory.
static Memory to_Memory(const ArrayPtr<T>&)Creates a Memory instance from the specified array.
std::enable_if<std::is_same<T1, char16_t>::value, String>::type ToString() constConverts the character memory to a string representation.
std::enable_if<!std::is_same<T1, char16_t>::value, String>::type ToString() constConverts the ordinary memory to a string representation.
bool TryCopyTo(const Memory&)Attempts to copy the contents of this memory to the destination memory.

Remarks

Exposes a span over the array region and supports slicing and copying.

See Also