mirror of
https://github.com/dwhinham/mt32-pi.git
synced 2026-10-26 22:11:05 +00:00
Remove array size from QSort template
This commit is contained in:
1 parent
510059adfe
commit
2601c58590
1 file changed
+4
-4
+4
-4
@@ -139,8 +139,8 @@ namespace Utility
|
||||
namespace
|
||||
{
|
||||
// Quicksort partition function (private)
|
||||
template<class T, size_t N>
|
||||
size_t Partition(T(&Items)[N], Comparator::TComparator<T> Comparator, size_t nLow, size_t nHigh)
|
||||
template<class T>
|
||||
size_t Partition(T* Items, Comparator::TComparator<T> Comparator, size_t nLow, size_t nHigh)
|
||||
{
|
||||
const size_t nPivotIndex = (nHigh + nLow) / 2;
|
||||
T* Pivot = &Items[nPivotIndex];
|
||||
@@ -171,8 +171,8 @@ namespace Utility
|
||||
}
|
||||
|
||||
// Sorts an array in-place using the Tony Hoare Quicksort algorithm
|
||||
template <class T, size_t N>
|
||||
void QSort(T(&Items)[N], Comparator::TComparator<T> Comparator = Comparator::LessThan<T>, size_t nLow = 0, size_t nHigh = N - 1)
|
||||
template <class T>
|
||||
void QSort(T* Items, Comparator::TComparator<T> Comparator, size_t nLow, size_t nHigh)
|
||||
{
|
||||
if (nLow < nHigh)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user