Struct Span<T>
- Namespace
- System
- Assembly
- System.Memory.dll
public readonly ref struct Span<T>
Type Parameters
T
- Inherited Members
-
- Extension Methods
-
Constructors
Span(void*, int)
[CLSCompliant(false)]
public Span(void* pointer, int length)
Parameters
pointer void*
length int
Span(T[])
Parameters
array T[]
Span(T[], int, int)
public Span(T[] array, int start, int length)
Parameters
array T[]
start int
length int
Properties
Empty
public static Span<T> Empty { get; }
Property Value
- Span<T>
IsEmpty
public bool IsEmpty { get; }
Property Value
- bool
this[int]
public ref T this[int index] { get; }
Parameters
index int
Property Value
- T
Length
public int Length { get; }
Property Value
- int
Methods
Clear()
CopyTo(Span<T>)
public void CopyTo(Span<T> destination)
Parameters
destination Span<T>
Fill(T)
public void Fill(T value)
Parameters
value T
GetEnumerator()
public Span<T>.Enumerator GetEnumerator()
Returns
- Span<T>.Enumerator
Slice(int)
public Span<T> Slice(int start)
Parameters
start int
Returns
- Span<T>
Slice(int, int)
public Span<T> Slice(int start, int length)
Parameters
start int
length int
Returns
- Span<T>
ToArray()
Returns
- T[]
ToString()
public override string ToString()
Returns
- string
TryCopyTo(Span<T>)
public bool TryCopyTo(Span<T> destination)
Parameters
destination Span<T>
Returns
- bool
Operators
operator ==(Span<T>, Span<T>)
public static bool operator ==(Span<T> left, Span<T> right)
Parameters
left Span<T>
right Span<T>
Returns
- bool
implicit operator Span<T>(ArraySegment<T>)
public static implicit operator Span<T>(ArraySegment<T> segment)
Parameters
segment ArraySegment<T>
Returns
- Span<T>
implicit operator ReadOnlySpan<T>(Span<T>)
public static implicit operator ReadOnlySpan<T>(Span<T> span)
Parameters
span Span<T>
Returns
- ReadOnlySpan<T>
implicit operator Span<T>(T[])
public static implicit operator Span<T>(T[] array)
Parameters
array T[]
Returns
- Span<T>
operator !=(Span<T>, Span<T>)
public static bool operator !=(Span<T> left, Span<T> right)
Parameters
left Span<T>
right Span<T>
Returns
- bool