Topic: qsort and comparison functions


Author: kanze@gabi-soft.fr (J. Kanze)
Date: 1995/07/21
Raw View
Jordan Zimmerman (jordanz@altura.com) wrote:

|> Are there idioms for creating type safe comparison functions for use with
|> qsort?  It seems to me that a templated version of qsort would be very
|> wasteful.

In what way?

The standard in fact contains a templated version of qsort.  It is
called sort (see section 25.3.1.1 in the draft standard).
--
James Kanze           (+33) 88 14 49 00          email: kanze@gabi-soft.fr
GABI Software, Sarl., 8 rue des Francs Bourgeois, 67000 Strasbourg, France
Conseils en informatique industrielle--
                             --Beratung in industrieller Datenverarbeitung





Author: maxtal@Physics.usyd.edu.au (John Max Skaller)
Date: 1995/07/14
Raw View
In article <jordanz-1007951733480001@204.147.232.52>,
Jordan Zimmerman <jordanz@altura.com> wrote:
>I didn't see any mention of this in the FAQ...
>
>Are there idioms for creating type safe comparison functions for use with
>qsort?  It seems to me that a templated version of qsort would be very
>wasteful.

 Use STL sort.

--
        JOHN (MAX) SKALLER,         INTERNET:maxtal@suphys.physics.su.oz.au
 Maxtal Pty Ltd,
        81A Glebe Point Rd, GLEBE   Mem: SA IT/9/22,SC22/WG21
        NSW 2037, AUSTRALIA     Phone: 61-2-566-2189





Author: jordanz@altura.com (Jordan Zimmerman)
Date: 1995/07/10
Raw View
I didn't see any mention of this in the FAQ...

Are there idioms for creating type safe comparison functions for use with
qsort?  It seems to me that a templated version of qsort would be very
wasteful.

Thanks.

--
Jordan Zimmerman, Altura Software
home page: http://www.altura.com/jordanz/home.html
Who is John Galt?





Author: jordanz@altura.com (Jordan Zimmerman)
Date: 1995/07/10
Raw View
> I didn't see any mention of this in the FAQ...
>
> Are there idioms for creating type safe comparison functions for use with
> qsort?  It seems to me that a templated version of qsort would be very
> wasteful.
>
> Thanks.
>
> --
> Jordan Zimmerman, Altura Software
> home page: http://www.altura.com/jordanz/home.html
> Who is John Galt?

Sorry... this was meant for comp.lang.c++

--
Jordan Zimmerman, Altura Software
home page: http://www.altura.com/jordanz/home.html
Who is John Galt?