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. Thanks in advance. Russell
One solution is to sort a set of pointers to the objects. Any sort
routine that lets you specify a sort function will let you sort the
pointers into the referenced objects' ordering.
On Wed, 15 Sep 2004 17:28:54 -0400, Russell Mok
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.
Thanks in advance.
Russell
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Tim Rowe
Pointer sort won't work in my case. Ultimately I do have to reorder the entries in the container. Just consider the whole container is memory mapped to a file. Indeed, there are multiple memory mapped containers and the sort is determined by one of these. Basically each record consists of one entry in each container. I have written a random access iterator to use the standard sort but creating temp objects for these memory mapped records is expensive. My application is somewhat memory bound. By the way, I think what I want is a sort that minimize the use of temporary copies. Swap is likely the alternative, but I am open to other solutions. Russell Tim Rowe wrote:
One solution is to sort a set of pointers to the objects. Any sort routine that lets you specify a sort function will let you sort the pointers into the referenced objects' ordering.
On Wed, 15 Sep 2004 17:28:54 -0400, 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.
Thanks in advance.
Russell
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
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
participants (3)
-
Howard Hinnant
-
Russell Mok
-
Tim Rowe