11[DebuggerDisplay(
"{ToString(),raw}")]
13public readonly
ref struct Span<T>
41 if (num <
_span.Length)
97 if (!typeof(T).IsValueType &&
array.GetType() != typeof(T[]))
117 if (!typeof(T).IsValueType &&
array.GetType() != typeof(T[]))
121 if ((ulong)((
long)(uint)
start + (
long)(uint)
length) > (ulong)(uint)
array.Length)
130 [CLSCompliant(
false)]
154 return !(left == right);
157 [Obsolete(
"Equals() on Span will always throw an exception. Use the equality operator instead.")]
164 [Obsolete(
"GetHashCode() on Span will always throw an exception.")]
189 ref T result = ref
Unsafe.NullRef<T>();
213 if (
Unsafe.SizeOf<T>() == 1)
263 if (typeof(T) == typeof(
char))
267 return $
"System.Span<{typeof(T).Name}>[{_length}]";
295 return Array.Empty<T>();
static void InitBlockUnaligned(ref byte startAddress, byte value, uint byteCount)
static void Memmove(ref byte dest, ref byte src, nuint len)
static unsafe ref byte GetArrayDataReference(Array array)
static string NotSupported_CannotCallGetHashCodeOnSpan
static string NotSupported_CannotCallEqualsOnSpan
static void ClearWithReferences(ref IntPtr ip, nuint pointerSizeLength)
static void ClearWithoutReferences(ref byte b, nuint byteLength)
static void ThrowArrayTypeMismatchException()
static void ThrowIndexOutOfRangeException()
static void ThrowArgumentOutOfRangeException(System.ExceptionArgument argument)
static void ThrowInvalidTypeWithPointersNotSupported(Type targetType)
static void ThrowArgumentException_DestinationTooShort()
Enumerator(Span< T > span)
Span< T > Slice(int start, int length)
void CopyTo(Span< T > destination)
Span(T[]? array, int start, int length)
Span(ref T ptr, int length)
readonly ByReference< T > _pointer
Enumerator GetEnumerator()
override bool Equals(object? obj)
static bool operator!=(Span< T > left, Span< T > right)
Span< T > Slice(int start)
override int GetHashCode()
ref T GetPinnableReference()
static bool operator==(Span< T > left, Span< T > right)
unsafe Span(void *pointer, int length)
override string ToString()
bool TryCopyTo(Span< T > destination)