Article View: comp.std.c++
Article #2138Re: sort algo and list<T> [Re: STL find errorprone]
From: John Max Skaller
Date: Fri, 06 Oct 1995 15:04
Date: Fri, 06 Oct 1995 15:04
48 lines
2890 bytes
2890 bytes
dick@silicon.csci.csusb.edu (Dr. Richard Botting) wrote:
>John Max Skaller (maxtal@suphys.physics.su.oz.au) wrote:
>
>: khan@xraylith.wisc.edu (Mumit Khan) wrote:
>: >
>: >2 people have already mentioned that they're dismayed by the fact
>: >that some algorithms explicitly exclude certain containers; eg., Cay
>: >Hosrtmann asks why the sort algorithm does not work with lists.
>
>: The reasons is that the performance guarrantees would not
>: be met. I personally find that a bit weak: often performance
>: is less an issue than utility.
>
>The old argument that a programmer costs more per minute than
>the CPU come in here I guess.
Yes. In fact, it is possible the requirements will be
weakened, or a version that works with lists supplied.
In any case, work-arounds are easy: lists support
bidirectional iterators which are functionally equivalent to
random ones, and one can convert bidirectional iterators
to random ones with trivial adaptors.
There is a serious threat that supplying too much
"convenience" will break the fundamentals of STL.
It has properties such as performance guarrantees,
operations doing just one thing, etc which make it
predicatble and reliable as a _basis_ for a full
blown library.
A half hearted attempted to extend that basis
_in_ the C++ Standard could be worse than leaving all
these problems to programmers (all of whome have
different requirements). [I.e. I'm arguing
that some minimalism is a good thing here]
--
John Max Skaller voice: 61-2-566-2189
81 Glebe Point Rd fax: 61-2-660-0850
GLEBE NSW 2037 email: maxtal@suphys.physics.oz.au
AUSTRALIA email: skaller@maxtal.com.au
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<453ccc$4cs@oznet07.ozemail.com.au>Path:
arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamageReferences:
<DED5p2.I2I@online.tmx.com.au> <MATT.95Sep9110458@physics10.Berkeley.EDU> <MATT.95Sep11121604@physics2.berkeley.edu> <4378m2$1n86@news.doit.wisc.edu> <43pf6r$14gi@news.doit.wisc.edu> <MATT.95Sep24201423@Austern> <44rtoa$l0o@news.csus.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage From: John Max Skaller <maxtal@suphys.physics.su.oz.au> Newsgroups: comp.std.c++ Subject: Re: sort algo and list<T> [Re: STL find errorprone] Date: 6 Oct 1995 15:04:11 GMT Organization: MAXTAL Approved: clamage@eng.sun.com (comp.std.c++) Message-ID: <453ccc$4cs@oznet07.ozemail.com.au> References: <DED5p2.I2I@online.tmx.com.au> <MATT.95Sep9110458@physics10.Berkeley.EDU> <MATT.95Sep11121604@physics2.berkeley.edu> <4378m2$1n86@news.doit.wisc.edu> <43pf6r$14gi@news.doit.wisc.edu> <MATT.95Sep24201423@Austern> <44rtoa$l0o@news.csus.edu> NNTP-Posting-Host: taumet.eng.sun.com Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; conversions="7bit, 7bit" Content-Transfer-Encoding: 7bit X-Nntp-Posting-Host: slsyd4p01.ozemail.com.au X-Mailer: Mozilla 1.2N (Windows; I; 16bit) X-Lines: 44 Content-Length: 1717 Originator: clamage@taumet