From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d275ffeffdf83655 X-Google-Attributes: gid103376,public X-Google-Thread: 146b77,d275ffeffdf83655 X-Google-Attributes: gid146b77,public X-Google-Thread: f5d71,d275ffeffdf83655 X-Google-Attributes: gidf5d71,public X-Google-Thread: 109fba,d275ffeffdf83655 X-Google-Attributes: gid109fba,public From: Matt Austern Subject: Re: Ada vs C++ vs Java Date: 1999/02/09 Message-ID: #1/1 X-Deja-AN: 442483936 Sender: austern@isolde.engr.sgi.com References: <369C1F31.AE5AF7EF@concentric.net> <369DDDC3.FDE09999@sea.ericsson.se> <369e309a.32671759@news.demon.co.uk> <77ledn$eu7$1@remarQ.com> <77pnqc$cgi$1@newnews.global.net.uk> <8p64spq5lo5.fsf@Eng.Sun.COM> <77t3ld$nou$1@nnrp1.dejanews.com> <79ce4s$lfq$1@nnrp1.dejanews.com> <79chc7$ko6@drn.newsguy.com> <79dodb$rhf$1@nnrp1.dejanews.com> <79fm3e$ffs$1@nnrp1.dejanews.com> <79fnce$iv8@drn.newsguy.com> <79grbs$d5u$1@nnrp1.dejanews.com> <79hujb$ck3@drn.newsguy.com> <36BF8BE4.93774F9E@linkline.com> Organization: SGI Newsgroups: comp.lang.ada,comp.lang.c++,comp.vxworks,comp.lang.java Date: 1999-02-09T00:00:00+00:00 List-Id: "Fredric L. Rice" writes: > > But a standard sort package would only specify the interface, and > > would leave the implementation up to the vendor. isn;t this how > > things are supposed to be? > > That's how it's done in the C++ world. qsort() is the function that is > normally called when a sort is desired and one must provide the guts > of the function. Well, more precisely qsort() is the sorting function that's normally called in the C world. In the C++ world, the usual sorting function is sort(). Although qsort() isn't officially deprecated in C++ (the C++ standard library includes the C standard library), it might as well be. I can't think of any occasion where it would be better to use qsort() than sort(). The generic sort() algorithm is easier to use, more flexible, safer, and more efficient.