Sort()
System::MemoryExtensions::Sort(const Span<T>&, const SharedPtr<TComparer>&) function
Sorts a Span using a custom comparer.
template<typename T,typename TComparer> void System::MemoryExtensions::Sort(const Span<T> &span, const SharedPtr<TComparer> &comparer)
Template parameters
| Parameter | Description |
|---|
| T | The type of elements in the span |
| TComparer | The type of the comparer object |
Arguments
| Parameter | Type | Description |
|---|
| span | const Span<T>& | The span to sort |
| comparer | const SharedPtr<TComparer>& | Smart pointer to comparer object for element comparison |
System::MemoryExtensions::Sort(Span<T>&) function
Sorts a Span using default comparison.
template<typename T> void System::MemoryExtensions::Sort(Span<T> &span)
Template parameters
| Parameter | Description |
|---|
| T | The type of elements in the span |
Arguments
| Parameter | Type | Description |
|---|
| span | Span<T>& | The span to sort |
System::MemoryExtensions::Sort(Span<TKey>&, Span<TValue>&, const SharedPtr<TComparer>&) function
Sorts key-value pairs using a custom comparer (keys and values sorted together)
template<typename TKey,typename TValue,typename TComparer> void System::MemoryExtensions::Sort(Span<TKey> &keys, Span<TValue> &values, const SharedPtr<TComparer> &comparer)
Template parameters
| Parameter | Description |
|---|
| TKey | The type of keys |
| TValue | The type of values |
| TComparer | The type of the comparer object |
Arguments
| Parameter | Type | Description |
|---|
| keys | Span<TKey>& | The span of keys to sort |
| values | Span<TValue>& | The span of values to sort (maintaining correspondence with keys) |
| comparer | const SharedPtr<TComparer>& | Smart pointer to comparer object for key comparison |
System::MemoryExtensions::Sort(Span<TKey>&, Span<TValue>&, System::Comparison<TKey>) function
Sorts key-value pairs using a comparison delegate.
template<typename TKey,typename TValue> void System::MemoryExtensions::Sort(Span<TKey> &keys, Span<TValue> &values, System::Comparison<TKey> comparer)
Template parameters
| Parameter | Description |
|---|
| TKey | The type of keys |
| TValue | The type of values |
Arguments
System::MemoryExtensions::Sort(Span<TKey>&, Span<TValue>&) function
Sorts key-value pairs using default comparison.
template<typename TKey,typename TValue> void System::MemoryExtensions::Sort(Span<TKey> &keys, Span<TValue> &values)
Template parameters
| Parameter | Description |
|---|
| TKey | The type of keys |
| TValue | The type of values |
Arguments
| Parameter | Type | Description |
|---|
| keys | Span<TKey>& | The span of keys to sort |
| values | Span<TValue>& | The span of values to sort |
See Also