Re: if statements vs. switch
Re: if statements vs. switch
- Subject: Re: if statements vs. switch
- From: Jeffrey J Barbose <email@hidden>
- Date: Wed, 4 Sep 2002 09:48:37 -0700
i believe the restriction on case labels is that the values must be
known at compile-time.
On Wednesday, Sep 4, 2002, at 09:27 US/Pacific, Chris Ridd wrote:
On 4/9/02 4:01 pm, Ondra Cada <email@hidden> wrote:
'Course it will. That's why it is limited to constants in 'case'
labels
(though I personally would prefer expressions allowed too, with a
fallback
to less efficient translation, but it is just not so).
I believe that in C++ case labels can be "const" variables, unlike C. I
expect there are caveats with that of course, like you can't cast a
value
into a const variable and have the switch use the new value etc etc.
Cheers,
Chris
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.