Conditional compilation inside asm and enum declarations

grauzone none at example.net
Wed Jul 15 03:41:23 PDT 2009


> The interesting question is is the construct itself the cause or the 
> effect of incoherence and bugginess?

Maybe. But the real problem is, that you can't force the user to specify 
either a "yes" or "no" for a specific version/define identifier. He 
still could just forget about it.

Of course, you could always write something like:

version (DEBUGGING) {
} else version (NODEBUGGING) {
} else {
	static assert(false, "you forgot something!");
}

(Or something similar.)

But that's a bit annoying.

> Even so, you *can* use negation in D version statements:
> 
>     version (NO_DEBUGGING) {} else
>     {
>     ... debugging is on ...
>     }

Only marginally better than a #ifndef NO_DEBUGGING.



More information about the Digitalmars-d mailing list