version(number) is completely useless
H. S. Teoh
hsteoh at qfbox.info
Tue Jul 26 13:27:55 UTC 2022
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
T
--
There are 10 kinds of people in the world: those who can count in binary, and those who can't.
More information about the Digitalmars-d
mailing list