語言

MemoryExtensions.Sort 方法

定義

使用指定的 Span<T>來排序整個Comparison<T>元素。

多載

名稱 Description
Sort<T,TComparer>(Span<T>, TComparer)

Span<T>利用 TComparer.

Sort<T>(Span<T>)

利用 Span<T> 中每個元素IComparable<T>的實作來排序整個Span<T>元素。

Sort<T>(Span<T>, Comparison<T>)

使用指定的 Span<T>來排序整個Comparison<T>元素。

Sort<TKey,TValue,TComparer>(Span<TKey>, Span<TValue>, TComparer)

根據第一個區域的 Span<T> 鍵,使用指定的比較器排序一對跨度(一個包含鍵,另一個包含對應項目)。

Sort<TKey,TValue>(Span<TKey>, Span<TValue>, Comparison<TKey>)

根據第一個鍵,使用指定的比較,排序一對跨度(一個包含鍵,另一個包含對應項目 Span<T> )。

Sort<TKey,TValue>(Span<TKey>, Span<TValue>)

根據第一個Span<T>IComparable<T>區域的鍵數,利用每個鍵的實作,排序一對跨度(一個包含鍵值,另一個包含相應項目)。

Sort<T,TComparer>(Span<T>, TComparer)

來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs

Span<T>利用 TComparer.

public:
generic <typename T, typename TComparer>
 where TComparer : System::Collections::Generic::IComparer<T>[System::Runtime::CompilerServices::Extension]
 static void Sort(Span<T> span, TComparer comparer);
public static void Sort<T,TComparer>(this Span<T> span, TComparer comparer) where TComparer : System.Collections.Generic.IComparer<T>;
static member Sort : Span<'T> * 'Comparer -> unit (requires 'Comparer :> System.Collections.Generic.IComparer<'T>)
<Extension()>
Public Sub Sort(Of T, TComparer) (span As Span(Of T), comparer As TComparer)

類型參數

T

跨度元素的類型。

TComparer

比較器類型,用來比較元素。

參數

span
Span<T>

要整理的記憶範圍。

comparer
TComparer

比較元素時所採用的方法,或 null 使用每個元素的 IComparable<T> 介面實作。

例外狀況

comparer是 null,且 中的span一個或多個元素不實作介面。IComparable<T>

在 的 comparer 實作過程中產生了錯誤。

適用於

Sort<T>(Span<T>)

來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs

利用 Span<T> 中每個元素IComparable<T>的實作來排序整個Span<T>元素。

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static void Sort(Span<T> span);
public static void Sort<T>(this Span<T> span);
static member Sort : Span<'T> -> unit
<Extension()>
Public Sub Sort(Of T) (span As Span(Of T))

類型參數

T

跨度元素的類型。

參數

span
Span<T>

要整理的記憶範圍。

例外狀況

其中span一個或多個元素並未實作介面。IComparable<T>

適用於

Sort<T>(Span<T>, Comparison<T>)

來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs

使用指定的 Span<T>來排序整個Comparison<T>元素。

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static void Sort(Span<T> span, Comparison<T> ^ comparison);
public static void Sort<T>(this Span<T> span, Comparison<T> comparison);
static member Sort : Span<'T> * Comparison<'T> -> unit
<Extension()>
Public Sub Sort(Of T) (span As Span(Of T), comparison As Comparison(Of T))

類型參數

T

跨度元素的類型。

參數

span
Span<T>

要整理的記憶範圍。

comparison
Comparison<T>

比較元素時應採用的方法。

例外狀況

comparison 是 null。

適用於

Sort<TKey,TValue,TComparer>(Span<TKey>, Span<TValue>, TComparer)

來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs

根據第一個區域的 Span<T> 鍵,使用指定的比較器排序一對跨度(一個包含鍵,另一個包含對應項目)。

public:
generic <typename TKey, typename TValue, typename TComparer>
 where TComparer : System::Collections::Generic::IComparer<TKey>[System::Runtime::CompilerServices::Extension]
 static void Sort(Span<TKey> keys, Span<TValue> items, TComparer comparer);
public static void Sort<TKey,TValue,TComparer>(this Span<TKey> keys, Span<TValue> items, TComparer comparer) where TComparer : System.Collections.Generic.IComparer<TKey>;
static member Sort : Span<'Key> * Span<'Value> * 'Comparer -> unit (requires 'Comparer :> System.Collections.Generic.IComparer<'Key>)
<Extension()>
Public Sub Sort(Of TKey, TValue, TComparer) (keys As Span(Of TKey), items As Span(Of TValue), comparer As TComparer)

類型參數

TKey

鍵跨中元素的類型。

TValue

物品元素的類型跨越。

TComparer

比較器類型,用來比較元素。

參數

keys
Span<TKey>

包含排序鍵的區間。

items
Span<TValue>

包含對應於 中 keys鍵的項目的跨度。

comparer
TComparer

IComparer<T>這是比較元素時使用的實作,或null是每個IComparable<T>元素的介面實作。

例外狀況

的 keys 長度不等於 的 items長度。

comparer是 null,且 中的keys一個或多個元素不實作介面。IComparable<T>

適用於

Sort<TKey,TValue>(Span<TKey>, Span<TValue>, Comparison<TKey>)

來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs

根據第一個鍵,使用指定的比較,排序一對跨度(一個包含鍵,另一個包含對應項目 Span<T> )。

public:
generic <typename TKey, typename TValue>
[System::Runtime::CompilerServices::Extension]
 static void Sort(Span<TKey> keys, Span<TValue> items, Comparison<TKey> ^ comparison);
public static void Sort<TKey,TValue>(this Span<TKey> keys, Span<TValue> items, Comparison<TKey> comparison);
static member Sort : Span<'Key> * Span<'Value> * Comparison<'Key> -> unit
<Extension()>
Public Sub Sort(Of TKey, TValue) (keys As Span(Of TKey), items As Span(Of TValue), comparison As Comparison(Of TKey))

類型參數

TKey

鍵跨中元素的類型。

TValue

物品元素的類型跨越。

參數

keys
Span<TKey>

包含排序鍵的區間。

items
Span<TValue>

包含對應於 中 keys鍵的項目的跨度。

comparison
Comparison<TKey>

比較元素時要用的。Comparison<T>

例外狀況

comparison 是 null。

的 keys 長度不等於 的 items長度。

適用於

Sort<TKey,TValue>(Span<TKey>, Span<TValue>)

來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs
來源:
MemoryExtensions.cs

根據第一個Span<T>IComparable<T>區域的鍵數,利用每個鍵的實作,排序一對跨度(一個包含鍵值,另一個包含相應項目)。

public:
generic <typename TKey, typename TValue>
[System::Runtime::CompilerServices::Extension]
 static void Sort(Span<TKey> keys, Span<TValue> items);
public static void Sort<TKey,TValue>(this Span<TKey> keys, Span<TValue> items);
static member Sort : Span<'Key> * Span<'Value> -> unit
<Extension()>
Public Sub Sort(Of TKey, TValue) (keys As Span(Of TKey), items As Span(Of TValue))

類型參數

TKey

鍵跨中元素的類型。

TValue

物品元素的類型跨越。

參數

keys
Span<TKey>

包含排序鍵的區間。

items
Span<TValue>

包含對應於 中 keys鍵的項目的跨度。

例外狀況

的 keys 長度不等於 的 items長度。

其中keys一個或多個元素並未實作介面。IComparable<T>

適用於