PhobosWatch: manifest => enum

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Sun Dec 30 09:19:37 PST 2007


0ffh wrote:
> because to me the rule "case guards can only be of integral type"
> seems to make the most sense. I'd be rather disappointed if case
> one didn't work...

Actually, D also allows string switch. However, I'm pretty sure you 
can't mix int "switch" with string "case"s :P.

Spec reference: 
http://www.digitalmars.com/d/1.0/statement.html#SwitchStatement
---
/Expression/ is evaluated. The result type T must be of integral type or 
char[], wchar[] or dchar[]. The result is compared against each of the 
case expressions. If there is a match, the corresponding case statement 
is transferred to.
---



More information about the Digitalmars-d mailing list