On Tue, 14 Dec 2010 21:46:47 +0300, Extrawurst <s...@extrawurst.org> wrote:
Hi i just want to discuss two points about D version statements.
1) Why is it not possible to negate the condition of a version
statement. I think it is unintuitive and keeps me writing weird
statements like:
version(Win32){}else{version = NotWin32;}
2) I would really like the idea to be able to get a compiletime string
of version identifiers in some kind of way. Perhaps even an array of
version-strings.
Any thoughts on that ?
Regards,
Stephan
Try using static if instead:
version (Win32) {
enum IsWin32 = true;
} else {
enum IsWin32 = false;
}
static if (IsWin32) {
// ...
}
static if (!IsWin32) {
// ...
}