SwapIfGreaterWithValues()
System::MemoryExtensions::Details::SwapIfGreaterWithValues(Span<TKey>&, Span<TValue>&, std::function<int32_t(const TKey&, const TKey&)>, int32_t, int32_t) function
Swaps key-value pairs if comparison condition is met.
template<typename TKey,typename TValue> void System::MemoryExtensions::Details::SwapIfGreaterWithValues(Span<TKey> &keys, Span<TValue> &values, std::function<int32_t(const TKey &, const TKey &)> comparer, int32_t i, int32_t j)
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 |
| values | Span<TValue>& | The span of values |
| comparer | std::function<int32_t(const TKey&, const TKey&)> | Comparison function for keys |
| i | int32_t | First index to compare |
| j | int32_t | Second index to compare |
See Also