How can I define a label inside a switch?

Meta via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Dec 14 10:48:15 PST 2014


On Sunday, 14 December 2014 at 18:41:54 UTC, MachineCode wrote:
> The labels are disabled then? I find that goto case case_value 
> ugly and prefer goto labelName; but if it's the only way to go 
> let's do it

I'm not sure if it's intentionally not supported, or just an 
oversight. Probably the former, so you should use "goto case". I 
agree it is annoying having to type out the expression for which 
case to go to; I can't remember if there was any rationale given 
for disallowing such a case.


More information about the Digitalmars-d-learn mailing list