System::ReadOnlySpan class

ReadOnlySpan class

Forward to use within Span class.

template<typename T>class ReadOnlySpan : public System::Details::SpanCore<const T, ReadOnlySpan<T>, Span<T>>
ParameterDescription
TThe type of elements in the span. This class provides a type-safe way to work with contiguous sequences of objects in a read-only manner. It can be used to wrap arrays, stack arrays, or raw pointers while maintaining bounds checking. The ReadOnlySpan doesn’t own the memory it points to - it’s just a view into existing memory.

Methods

MethodDescription
ReadOnlySpan(const Span<T>&)Constructs a read-only span from a regular span.
static to_ReadOnlySpan(const typename BaseType::ArrayPtrT&)Converts an array to a ReadOnlySpan.

Remarks

Represents a read-only contiguous region of arbitrary memory.

See Also