From -5344513481311628405
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,bc82bd0900b8b4ac
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2000-12-22 03:26:01 PST
Path: supernews.google.com!sn-xit-02!supernews.com!news-x.support.nl!newspeer.clara.net!news.clara.net!dispose.news.demon.net!demon!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: sirwillard@my-deja.com
Newsgroups: comp.std.c++
Subject: Re: Feature Request: Fast "find" for sorted random access containers
Date: Fri, 22 Dec 2000 11:25:25 GMT
Organization: Deja.com
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <91u1uu$18$1@nnrp1.deja.com>
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>
X-Trace: mail2news.demon.co.uk 977484332 mail2news:3787 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)
X-Article-Creation-Date: Thu Dec 21 22:58:41 2000 GMT
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
X-Http-Proxy: 1.1 cacdca02, 1.1 x62.deja.com:80 (Squid/1.1.22) for client 167.16.75.51, 170.186.97.229
X-Mydeja-Info: XMYDJUIDsirwillard
Lines: 64
Xref: supernews.google.com comp.std.c++:3078

In article <remove.haberg-2112001922500001@du158-226.ppp.su-
anst.tninet.se>,
  remove.haberg@matematik.su.se (Hans Aberg) wrote:
> In article <91t6j2$7cf$1@nnrp1.deja.com>, Niklas Mellin
> <nimel@my-deja.com> wrote:
> >Isn't an error reported by the compiler the same thing as a
diagnostic
> >in most cases?
>
> I do not know what you mean with a "diagnostic". For a compiler, an
> "error" is a message that aborts the compiler output, whereas
a "warning"
> is a message that still produces the object code output.

>From the standard:

[defns.diagnostic] 1.3.2 diagnostic message
a message belonging to an implementation-defined subset of the
implementation_s output messages.

Both warnings and errors are diagnostics.

> 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.

Yes.  Though I'd also go as far as to say it's not only inefficient,
but wrong.  Using operator[] denotes random access, which is something
you can't do with a list.

> 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.

There is... use the alternative interface "std::advance".

> -- Perhaps this is a good suggestion, that one can put in macro
directives like
>   #warning list::operator[] is inefficient
> or
>   #info Have a nice day!

This simply wouldn't work.  You only want a diagnostic to be given if
the user attempts to use them.  A #warning would generate a diagnostic
simply by including the header.

--
William E. Kempf
Software Engineer, MS Windows Programmer


Sent via Deja.com
http://www.deja.com/

---
[ 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.     ]



