IntroSort()

System::MemoryExtensions::Details::IntroSort(Span<TKey>&, Span<TValue>&, int32_t, std::function<int32_t(const TKey&, const TKey&)>) function

Internal implementation of introsort algorithm for key-value pairs.

template<typename TKey,typename TValue> void System::MemoryExtensions::Details::IntroSort(Span<TKey> &keys, Span<TValue> &values, int32_t depthLimit, std::function<int32_t(const TKey &, const 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
depthLimitint32_tMaximum recursion depth before switching to heapsort
comparerstd::function<int32_t(const TKey&, const TKey&)>Comparison function for keys

See Also