version(number) is completely useless

Steven Schveighoffer schveiguy at gmail.com
Tue Jul 26 13:34:03 UTC 2022


On 7/26/22 9:27 AM, H. S. Teoh wrote:
> On Tue, Jul 26, 2022 at 10:52:29AM +0000, Andrey Zherikov via Digitalmars-d wrote:
> [...]
>> As a library developer I want to provide some SLA to the users: I
>> guarantee that my library will be successfully built by all versions
>> of all compilers (ldc,gdc,dmd) that are one year old or newer. The
>> thing is that compilers evolve (they got new features, bug fixes etc)
>> and I want my codebase evolve with them. I can easily check what
>> compiler is used by `version(DigitalMars)` e.g.. But how should I
>> check that a specific feature is added to compiler/phobos or a
>> specific bug is fixed?
> 
> 	static if (__VERSION__ == 2098L) {
> 		... // 2.098-specific code
> 	}
> 	static if (__VERSION__ == 2100L) {
> 		... // 2.100-specific code
> 	}
> 	// and so on
> 
> 

Ironic that DMD's provided meta doesn't feel the burden of dealing with 
the crippled version system.

-Steve


More information about the Digitalmars-d mailing list