From 7232322507424546286
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,5be30c38f618a07b
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2002-04-01 13:40:09 PST
Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!nntp.cs.ubc.ca!sunqbc.risq.qc.ca!news.maxwell.syr.edu!news.alt.net!comp-std-cpp-robomod!not-for-mail
From: Gennaro Prota <gennaro_prota@yahoo.com>
Newsgroups: comp.std.c++
Subject: Re: Why switch w/ only integral types?
Date: Mon,  1 Apr 2002 15:39:35 CST
Organization: [Infostrada]
Lines: 22
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <p08faug624cec5407tchjthj1fdmi7ink7@4ax.com>
References: <6ee7d287.0203202005.63e0b7b3@posting.google.com> <qfpm8.12422$cy2.680922353@newssvr21.news.prodigy.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Return-Path: <devnull@stump.algebra.com>
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-Newsreader: Forte Agent 1.9/32.560 trialware
X-Complaints-To: abuse@libero.it
X-Trace: twister1.libero.it 1017618427 151.26.100.128 (Mon, 01 Apr 2002 01:47:07 MET DST)
NNTP-Posting-Date: Mon, 01 Apr 2002 01:47:07 MET DST
Xref: archiver1.google.com comp.std.c++:10338

On Thu, 21 Mar 2002 18:04:50 GMT, "Carl Daniel" <cpdaniel@pacbell.net>
wrote:

>Nevertheless, there are many languages which do permit arbirtray types in
>switch/case constructs, so I doubt there's any technical reason why C++
>couldn't have been specified that way.

At least for why *floating points* are not allowed, the motivation, as
given in both the C89 rationale and the C99 draft rationale, is that
"exact equality in floating point is not portable". There's no clue
however as to why other types are prohibited too. To be honest, I'm
quite suspicious about the "hard to optimize" motivation.


Genny.

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



