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

ParameterDescription
TThe type of elements in the span
TComparerThe type of the comparer object

Arguments

ParameterTypeDescription
spanconst Span<T>&The span to sort
comparerconst 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

ParameterDescription
TThe type of elements in the span

Arguments

ParameterTypeDescription
spanSpan<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

ParameterDescription
TKeyThe type of keys
TValueThe type of values
TComparerThe type of the comparer object

Arguments

ParameterTypeDescription
keysSpan<TKey>&The span of keys to sort
valuesSpan<TValue>&The span of values to sort (maintaining correspondence with keys)
comparerconst 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

ParameterDescription
TKeyThe type of keys
TValueThe type of values

Arguments

ParameterTypeDescription
keysSpan<TKey>&The span of keys to sort
valuesSpan<TValue>&The span of values to sort
comparerSystem::Comparison<TKey>Comparison delegate for key comparison

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

ParameterDescription
TKeyThe type of keys
TValueThe type of values

Arguments

ParameterTypeDescription
keysSpan<TKey>&The span of keys to sort
valuesSpan<TValue>&The span of values to sort

See Also