Method Sort
Sort<T>(ExSpan<T>)
Sorts the elements in the entire ExSpan<T> using the IComparable<T> implementation of each element of the ExSpan<T>
public static void Sort<T>(this ExSpan<T> span)
Parameters
Type Parameters
TThe type of the elements of the span.
Exceptions
- InvalidOperationException
One or more elements in
spando not implement the IComparable<T> interface.
Sort<T, TComparer>(ExSpan<T>, TComparer)
Sorts the elements in the entire ExSpan<T> using the TComparer.
public static void Sort<T, TComparer>(this ExSpan<T> span, TComparer comparer) where TComparer : IComparer<T>?
Parameters
spanExSpan<T>The ExSpan<T> to sort.
comparerTComparerThe IComparer<T> implementation to use when comparing elements, or null to use the IComparable<T> interface implementation of each element.
Type Parameters
TThe type of the elements of the span.
TComparerThe type of the comparer to use to compare elements.
Exceptions
- InvalidOperationException
compareris null, and one or more elements inspando not implement the IComparable<T> interface.- ArgumentException
The implementation of
comparercaused an error during the sort.
Sort<T>(ExSpan<T>, Comparison<T>)
Sorts the elements in the entire ExSpan<T> using the specified Comparison<T>.
public static void Sort<T>(this ExSpan<T> span, Comparison<T> comparison)
Parameters
spanExSpan<T>The ExSpan<T> to sort.
comparisonComparison<T>The Comparison<T> to use when comparing elements.
Type Parameters
TThe type of the elements of the span.
Exceptions
- ArgumentNullException
comparisonis null.
Sort<TKey, TValue>(ExSpan<TKey>, ExSpan<TValue>)
Sorts a pair of ExSpans (one containing the keys and the other containing the corresponding items) based on the keys in the first ExSpan<T> using the IComparable<T> implementation of each key.
public static void Sort<TKey, TValue>(this ExSpan<TKey> keys, ExSpan<TValue> items)
Parameters
keysExSpan<TKey>The span that contains the keys to sort.
itemsExSpan<TValue>The span that contains the items that correspond to the keys in
keys.
Type Parameters
TKeyThe type of the elements of the key span.
TValueThe type of the elements of the items span.
Exceptions
- ArgumentException
The length of
keysisn't equal to the length ofitems.- InvalidOperationException
One or more elements in
keysdo not implement the IComparable<T> interface.
Sort<TKey, TValue, TComparer>(ExSpan<TKey>, ExSpan<TValue>, TComparer)
Sorts a pair of ExSpans (one containing the keys and the other containing the corresponding items) based on the keys in the first ExSpan<T> using the specified comparer.
public static void Sort<TKey, TValue, TComparer>(this ExSpan<TKey> keys, ExSpan<TValue> items, TComparer comparer) where TComparer : IComparer<TKey>?
Parameters
keysExSpan<TKey>The span that contains the keys to sort.
itemsExSpan<TValue>The span that contains the items that correspond to the keys in
keys.comparerTComparerThe IComparer<T> implementation to use when comparing elements, or null to use the IComparable<T> interface implementation of each element.
Type Parameters
TKeyThe type of the elements of the key span.
TValueThe type of the elements of the items span.
TComparerThe type of the comparer to use to compare elements.
Exceptions
- ArgumentException
The length of
keysisn't equal to the length ofitems.- InvalidOperationException
compareris null, and one or more elements inkeysdo not implement the IComparable<T> interface.
Sort<TKey, TValue>(ExSpan<TKey>, ExSpan<TValue>, Comparison<TKey>)
Sorts a pair of ExSpans (one containing the keys and the other containing the corresponding items) based on the keys in the first ExSpan<T> using the specified comparison.
public static void Sort<TKey, TValue>(this ExSpan<TKey> keys, ExSpan<TValue> items, Comparison<TKey> comparison)
Parameters
keysExSpan<TKey>The span that contains the keys to sort.
itemsExSpan<TValue>The span that contains the items that correspond to the keys in
keys.comparisonComparison<TKey>The Comparison<T> to use when comparing elements.
Type Parameters
TKeyThe type of the elements of the key span.
TValueThe type of the elements of the items span.
Exceptions
- ArgumentNullException
comparisonis null.- ArgumentException
The length of
keysisn't equal to the length ofitems.