version(number) is completely useless

Andrey Zherikov andrey.zherikov at gmail.com
Thu Jul 28 14:57:57 UTC 2022


On Wednesday, 27 July 2022 at 17:16:30 UTC, Walter Bright wrote:
> On 7/27/2022 7:24 AM, Andrey Zherikov wrote:
>> What's your recommendation about how I should check for a 
>> specific feature/bugfix? Should I use `static if(__VERSION__ 
>> ...)`, `static if(__traits(compiles, { ... }))` or something 
>> else?
>
> __VERSION__ is certainly more convenient.
>
> Though, since upgrades to the compiler are free, a simpler 
> strategy would be to just require a __VERSION__ past a certain 
> point.

Did I get you right that you discourage using `static if` for 
versioning the code (according to [this 
post](https://forum.dlang.org/post/tbair7$2ltc$1@digitalmars.com)) with an exception for `static if(__VERSION__ ...)`?


More information about the Digitalmars-d mailing list