home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sdd.hp.com!sgiblab!sgigate!odin!sam.wpd.sgi.com!pj
- From: pj@sam.wpd.sgi.com (Paul Jackson)
- Subject: Re: Making qsort type-safe
- Message-ID: <1992Nov5.050814.28150@odin.corp.sgi.com>
- Sender: news@odin.corp.sgi.com (Net News)
- Nntp-Posting-Host: sam.wpd.sgi.com
- Reply-To: pj@sgi.com
- Organization: Silicon Graphics, Research & Development
- References: <1992Nov4.162131.10289@cs.brown.edu> <1992Nov5.004640.24689@netcom.com>
- Date: Thu, 5 Nov 1992 05:08:14 GMT
- Lines: 25
-
- In article <1992Nov5.004640.24689@netcom.com>, mdr@netcom.com (Marc D. Rossner) writes:
- |> In article <1992Nov4.162131.10289@cs.brown.edu>, sdm@cs.brown.edu (Scott Meyers) writes:
- |> [[ Deleted: example template wrapper for qsort ]]
- |>
- |> Heesh, this principle of "not reinventing the wheel" can be taken to
- |> extremes. It's really not THAT much effort to just write a templatized
- |> qsort for C++ directly (Lippman, 2nd ed. has it on page 194, in about 15 lines
- |> of code).
-
- A similar qsort() is on page 94++ of Hansen's "The C++ Answer
- Book." Hansen then spends another six pages and a few hundred
- lines of code improving it, to be more "industrial strength."
- The qsort in the libc nearest to me at the moment has 209 source
- lines, including comments.
-
- This is not a religious issue to me -- sometimes I reuse,
- sometimes reimplement. But in this case the trade offs are very
- clear - use the libc qsort, perhaps with the nifty wrapper Scott
- suggested. Thanks Scott.
-
- --
-
- I won't rest till it's the best ...
- Software Production Engineer
- Paul Jackson (pj@sgi.com), x1373
-