#ifndef _QUICKSORT_HPP_ #error QSORT.HPP must precede QSORT.TPP #endif template QuickSort::QuickSort(void) : mlpItemList(0) { } template QuickSort::~QuickSort() { } template void QuickSort::sortItems(T HUGE *lpItemList,long itemCount,SortOptions::SortOrder sortOrder) { mlpItemList=lpItemList; if(SortOptions::Ascending==sortOrder)quickSort(0,itemCount); else quickSortDescending(0,itemCount); } template void QuickSort::quickSort(long left,long right) { long tempLeft(left); long tempRight(right); T tempItem; T swapItem; tempItem=*((T FAR*)(mlpItemList+((left+right)/2L))); do{ while(*(mlpItemList+tempLeft) void QuickSort::quickSortDescending(long left,long right) { long tempLeft(left); long tempRight(right); T tempItem; T swapItem; tempItem=*((T FAR*)(mlpItemList+((left+right)/2L))); do{ while(*(mlpItemList+tempLeft)>tempItem)tempLeft++; while(tempItem>*((T FAR*)(mlpItemList+tempRight)))tempRight--; if(tempLeft<=tempRight) { swapItem=*((T FAR*)(mlpItemList+tempLeft)); *((T FAR*)(mlpItemList+tempLeft))=*((T FAR*)(mlpItemList+tempRight)); *((T FAR*)(mlpItemList+tempRight))=swapItem; tempLeft++; tempRight--; } }while(tempLeft<=tempRight); if(left