C/C++ language proposal: Change the 'case expression' from "integralconstant-expression" to "integral expression"

C/C++ language proposal: Change the 'case expression' from "integralconstant-expression" to "integral expression"

Post by Keith Thom » Sun, 26 Oct 2008 12:05:22


CBFalconer < XXXX@XXXXX.COM > writes:


Which completely and utterly misses the point.

The article that started this thread was a proposal to allow
non-constant case expressions. anon's point was that it would then
become impossible (or nearly so) to maintain the property that all
case expressions in a switch statement must have distinct values.
Your "correction" is valid C, but pointless; you might as well have
posted "int main(void) { }".


Perhaps, but the topic of the thread is a proposed change to both C
and C++. Arguably the comp.std.* groups would have been better, but I
think comp.std.c++ is more or less dead these days. Since switch
statements have the same syntax and semantics in C and C++, it's not
entirely unreasonable to discuss a proposed change in both.

--
Keith Thompson (The_Other_Keith) XXXX@XXXXX.COM < http://www.yqcomputer.com/ ~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
 
 

C/C++ language proposal: Change the 'case expression' from "integralconstant-expression" to "integral expression"

Post by gazell » Sun, 26 Oct 2008 12:19:22

In article < XXXX@XXXXX.COM >,

...

It's what Chuck does best. One should always play to one's strengths.