CollectionsMarshal.AsSpan<T>(List<T>) Metoda

Definicja

Span<T> Pobiera widok danych na liście. Elementy nie powinny być dodawane ani usuwane z List<T> obiektu , gdy Span<T> element jest używany.

public:
generic <typename T>
 static Span<T> AsSpan(System::Collections::Generic::List<T> ^ list);
public static Span<T> AsSpan<T> (System.Collections.Generic.List<T>? list);
static member AsSpan : System.Collections.Generic.List<'T> -> Span<'T>
Public Shared Function AsSpan(Of T) (list As List(Of T)) As Span(Of T)

Parametry typu

T

Typ elementów na liście.

Parametry

list
List<T>

Lista, z której ma zostać utworzony element Span<T>.

Zwraca

Wystąpienie Span<T> za pośrednictwem klasy List<T>.

Dotyczy