From 1173076559153534775
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,bc82bd0900b8b4ac
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-01-05 09:12:21 PST
Path: supernews.google.com!sn-xit-02!supernews.com!news.cs.utwente.nl!newshunter!cosy.sbg.ac.at!news.tele.dk!212.74.64.35!colt.net!dispose.news.demon.net!demon!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: remove.haberg@matematik.su.se (Hans Aberg)
Newsgroups: comp.std.c++
Subject: Re: Feature Request: Fast "find" for sorted random access containers
Date: Fri,  5 Jan 2001 17:08:26 GMT
Organization: Mathematics
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <remove.haberg-0401012028180001@du132-226.ppp.su-anst.tninet.se>
References: <remove.haberg-1712001452460001@du131-226.ppp.su-anst.tninet.se> <gums3t4chvsdcuaipte3atg51f5l16cvn2@4ax.com> <remove.haberg-1812002251330001@du134-226.ppp.su-anst.tninet.se> <3A3F63A6.527B4E5D@wizard.net> <remove.haberg-2012000045090001@du129-226.ppp.su-anst.tninet.se> <91qnl7$86m$1@nnrp1.deja.com> <remove.haberg-2012002256280001@du148-226.ppp.su-anst.tninet.se> <91t6j2$7cf$1@nnrp1.deja.com> <remove.haberg-2112001922500001@du158-226.ppp.su-anst.tninet.se> <3A53B49D.3D70967A@wizard.net>
X-Trace: mail2news.demon.co.uk 978714517 mail2news:22014 mail2news mail2news.demon.co.uk
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
NNTP-Posting-Date: 4 Jan 2001 19:28:19 GMT
Lines: 44
Xref: supernews.google.com comp.std.c++:3210

In article <3A53B49D.3D70967A@wizard.net>, James Kuyper
<kuyper@wizard.net> wrote:
>> In the context we discussed here, it was said that one didn't implement
 operator +, -, [], ... on the "list" class because it one thought people
 might using the without being aware of that is inefficient.
 So I got the impression it was a kind of informational statement to the
 effect that the algorithm is inefficient. But if one is using such an
 algorithm, there should be a way to turn off the diagnostic message. <<

>Sorry - I didn't mean to imply that the diagnostic would contain any
>useful information about the reason for the diagnostic; that's purely a
>QoI issue.
>All I meant was that any code which requires random access to a
>container will almost always trigger a mandatory diagnostic when passed
>a container type (such as list<T>) which doesn't support random access.
>However, there's no requrement that the diagnostic contain any useful
>information.

Anyway, it seems me that one should implement operator +, -, [], ... on
the "list" class and other containers where possible, merely jotting down
the complexities in the new revision.

If one does not like the prospect that people may write inefficient code,
one should figure out a warning system for that:

I think that a suitable warning system is a profiler, which will tell you
which portions of the code that will be needed to be rewritten for any
particular program.

The idea of using an "advance" class just causes one to move away from the
original idea of name overloading.

  Hans Aberg      * Anti-spam: remove "remove." from email address.
                  * Email: Hans Aberg <remove.haberg@member.ams.org>
                  * Home Page: <http://www.matematik.su.se/~haberg/>
                  * AMS member listing: <http://www.ams.org/cml/>

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]
[ Note that the FAQ URL has changed!  Please update your bookmarks.     ]



