version(number) is completely useless

Paul Backus snarwin at gmail.com
Tue Jul 26 14:05:30 UTC 2022


On Tuesday, 26 July 2022 at 10:52:29 UTC, Andrey Zherikov wrote:
> But how should I check that a specific feature is added to 
> compiler/phobos or a specific bug is fixed?

You can use introspection to check for features and bug fixes 
directly:

```d
static if (__traits(compiles, { import std.whatever: someSymbol; 
}))
{
     // std.whatever.someSymbol exists
}

private bool hasBug()
{
     // test case for bug
}

static if (hasBug)
{
     // workaround for bug
}
else
{
     // code without the workaround
}
```


More information about the Digitalmars-d mailing list