Inversion of conditional compilation statements

user1234 user1234 at 12.de
Sat Dec 2 14:25:43 UTC 2023


On Saturday, 2 December 2023 at 13:16:26 UTC, Johannes 
Miesenhardt wrote:
> Hello,
>
> [...]
>
> I see the way why it doesn't work, but I think it should. 
> Considering that
> `version (Test) {} else {`
> works without any issue but looks very ugly.
>
> Can somebody explain if this is an intended decision or what I 
> should do instead of using my ugly replacement?

It's an intended decision that's often debated, a.k.a "version 
algebra". The official position on version algebra is that 
complex conditions (think `&&` and `||`) would be a source of 
bugs.


More information about the Digitalmars-d-learn mailing list