switch generation
Mafi
mafi at example.org
Sat Jul 16 03:31:30 PDT 2011
This code worked in dmd 2.052:
///////
ubyte[] getIncludedFileImpl(FS...)(string file) {
switch(file) {
foreach(F; FS) { //ct foreach
//forever in love with you D
case F: return cast(ubyte[]) import(F);
}
default: throw new Exception(format("A needed included file not
found %s", file));
}
assert(0);
}
///////
It does not work anymore. I know about switch changes but the following
doesn't work either:
///////
ubyte[] getIncludedFileImpl(FS...)(string file) {
switch(file) {
foreach(F; FS) { //ct foreach
//forever in love with you D
case F: return cast(ubyte[]) import(F);
break; // <--- here
}
default: throw new Exception(format("A needed included file not
found %s", file));
}
assert(0);
}
////////
How can I fix this code?
Mafi
PS: I know I can be done with some ugly string mixins but I want it to
work somewhat like it worked before.
More information about the Digitalmars-d-learn
mailing list