version(number) is completely useless

Walter Bright newshound2 at digitalmars.com
Wed Jul 27 03:42:07 UTC 2022


On 7/26/2022 3:52 AM, Andrey Zherikov wrote:
> But how should I check that a specific 
> feature is added to compiler/phobos or a specific bug is fixed?

Create a single "configuration module", which has a section for each version:

--------
module config;

version (DigitalMars)
{
     import digitalmars;
}
else version (LDC)
{
     import ldc;
}
else version (GDC)
{
     import gdc;
}
else
{
     static assert(0, "unsupported system");
}
---------

Now, in digitalmars.d and ldc.d and gdc.d, do what it takes to make that 
configuration work for your code.

This makes it really easy to concentrate, say, in ldc.d, just on ldc's 
characteristics. Rather than having to constantly confuse yourself with which 
configuration is compiling what code.

It also immediately points out when the code is being built for a version you 
have not anticipated.


More information about the Digitalmars-d mailing list