Howard wrote:
On Sep 15, 2004, at 5:28 PM, Russell Mok wrote:
I know this is kinda off topic.
I am trying to sort some objects which are expensive to copy. Does anyone know a sort implementation that uses neither copier nor assignment? The STLport version I have is using both. Worse, some routines are passing arguments as T instead of const T &. I did search boost and google but I couldn't find what I want.
The Metrowerks implementation of std::sort uses swap (unqualified) exclusively.
-Howard
Another idea which I think works out for simplicity is to just sort an array of pointers, and then once all items are in order, you change the ordering on disk. I think this would be your biggest performance gains, as most sorting has a lot of intermediate steps. You can do all those fast with the pointers, and then do the slow sort of the files. John =:->