CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
System::ReadOnlySpan< T > Class Template Reference

Forward to use within Span class. More...

#include <span.h>

Inherits System::Details::SpanCore< const T, ReadOnlySpan< T >, Span< T > >.

Public Member Functions

 ReadOnlySpan (const Span< T > &span)
 Constructs a read-only span from a regular span. More...
 

Static Public Member Functions

static ThisType to_ReadOnlySpan (const typename BaseType::ArrayPtrT &array)
 Converts an array to a ReadOnlySpan. More...
 

Detailed Description

template<typename T>
class System::ReadOnlySpan< T >

Forward to use within Span class.

Represents a read-only contiguous region of arbitrary memory.

Template Parameters
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.

Constructor & Destructor Documentation

◆ ReadOnlySpan()

template<typename T >
System::ReadOnlySpan< T >::ReadOnlySpan ( const Span< T > &  span)
inline

Constructs a read-only span from a regular span.

Parameters
spanThe span to create a read-only view of.

Member Function Documentation

◆ to_ReadOnlySpan()

template<typename T >
static ThisType System::ReadOnlySpan< T >::to_ReadOnlySpan ( const typename BaseType::ArrayPtrT &  array)
inlinestatic

Converts an array to a ReadOnlySpan.

Parameters
arrayThe array to convert.
Returns
A read only span representing the array.