About switch case statements...

Chad J chadjoan at __spam.is.bad__gmail.com
Sun Nov 15 11:07:05 PST 2009


Andrei Alexandrescu wrote:
> 
> Walter's answer to that has put me to silence for good. "But I use
> fall-through all the time!" I then knew the feature will never make it.
> 

T_T

There has to be a better way to do fall-through.

Maybe...

switch(foo)
{
    case 0;
    case 1; bar = baz; // Executed if foo == 0
    case 2:
        doSomething(bar); // Executed for foo ∈ {0,1,2}
        break; //required for compile success.
}



More information about the Digitalmars-d mailing list