void main() { alias TestType = ulong; // won't compile if = ubyte import std.stdio; TestType a,b,c; readf("%s %s %s ", &a, &b, &c); switch(c){ case a: writeln("a");break; case b: writeln("b");break; default: assert(false); } }
switch statement with variable branches
Yuxuan Shui via Digitalmars-d-learn Wed, 18 Jan 2017 17:26:48 -0800
Somehow I can't use ubyte variables behind 'case', but ulong
works fine. Why is that?
- switch statement with variable branch... Yuxuan Shui via Digitalmars-d-learn
- Re: switch statement with variab... Ali Çehreli via Digitalmars-d-learn
- Re: switch statement with va... Yuxuan Shui via Digitalmars-d-learn
- Re: switch statement with variab... Stefan Koch via Digitalmars-d-learn