New thing I learned for the day

Steven Schveighoffer schveiguy at gmail.com
Tue Nov 26 15:28:38 UTC 2019


Did you know this was valid syntax? I didn't.

static if(cond)
    ...
else: // wat...


seen here:
https://github.com/dlang/phobos/blob/3bfccf4f160a07165682549407eaeec5c8907c82/std/utf.d#L4213-L4215

Only seems to work outside of functions, and naturally then not for 
normal if statements.

-Steve


More information about the Digitalmars-d mailing list