Sort
Sorts an array in ascending order.
Read time 3 minutesLast updated 10 days ago
Definition
- Type: Method
- Namespace: Unity.Collections
- Assembly: UnityEngine.ManagedKernelModule
Sort<T>(`<>*, int)
Sorts an array in ascending order.
public static void Sort<T>(T* ptr, int length) where T : unmanaged, IComparable<T>
Parameters
Sort<T, U>(`<>*, int, T)
Sorts an array using a custom comparison.
public static void Sort<T, U>(T* ptr, int length, U comp) where T : unmanaged where U : IComparer<T>
Parameters
Sort<T>(Span<T>)
Sorts this span in ascending order.
public static void Sort<T>(this Span<T> span) where T : unmanaged, IComparable<T>
Parameters
The span to sort.
Sort<T, U>(Span<T>, T)
Sorts this span using a custom comparison.
public static void Sort<T, U>(this Span<T> span, U comp) where T : unmanaged where U : IComparer<T>
Parameters
The span to sort.
Sort<T>(NativeArray<T>)
Sorts this array in ascending order.
public static void Sort<T>(this NativeArray<T> container) where T : unmanaged, IComparable<T>
Parameters
The array to sort.
Sort<T, U>(NativeArray<T>, T)
Sorts this array using a custom comparison.
public static void Sort<T, U>(this NativeArray<T> container, U comp) where T : unmanaged where U : IComparer<T>
Parameters
The array to sort.
Sort<T>(NativeList<T>)
Sorts this list in ascending order.
public static void Sort<T>(this NativeList<T> container) where T : unmanaged, IComparable<T>
Parameters
The list to sort.
Sort<T, U>(NativeList<T>, T)
Sorts this list using a custom comparison.
public static void Sort<T, U>(this NativeList<T> container, U comp) where T : unmanaged where U : IComparer<T>
Parameters
The list to sort.
Sort<T>(UnsafeList<T>)
Sorts this list in ascending order.
public static void Sort<T>(this UnsafeList<T> container) where T : unmanaged, IComparable<T>
Parameters
The list to sort.
Sort<T, U>(UnsafeList<T>, T)
Sorts the list using a custom comparison.
public static void Sort<T, U>(this UnsafeList<T> container, U comp) where T : unmanaged where U : IComparer<T>
Parameters
The list to sort.
Sort<T>(NativeSlice<T>)
Sorts this slice in ascending order.
public static void Sort<T>(this NativeSlice<T> container) where T : unmanaged, IComparable<T>
Parameters
The slice to sort.
Sort<T, U>(NativeSlice<T>, T)
Sorts this slice using a custom comparison.
public static void Sort<T, U>(this NativeSlice<T> container, U comp) where T : unmanaged where U : IComparer<T>
Parameters
The slice to sort.