Thread overview
[Issue 19495] Lack of version conjunctions
Dec 17, 2018
anonymous4
Jun 30, 2019
Basile-z
Mar 21, 2020
Basile-z
December 17, 2018
https://issues.dlang.org/show_bug.cgi?id=19495

anonymous4 <dfj1esp02@sneakemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |spec
           Hardware|x86                         |All
                 OS|Mac OS X                    |All

--- Comment #1 from anonymous4 <dfj1esp02@sneakemail.com> ---
Currently version statement is optimized for speed, you can have arbitrary logic with static if.

---
template Defined(string s)
{
    mixin(`version(`~s~`)enum Defined=true;else enum Defined=false;`);
}

struct SVersion
{
    alias opDispatch(string s)=Defined!s;
}
enum Version=SVersion();

int main()
{
    static if(Version.OSX)writeln("running OSX");
    else writeln("no");
    return 0;
}
---

--
June 30, 2019
https://issues.dlang.org/show_bug.cgi?id=19495

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |b2.temp@gmx.com
         Resolution|---                         |DUPLICATE

--- Comment #2 from Basile-z <b2.temp@gmx.com> ---
This enhancement request but the language designers are not in favor of it. Anyway it was already opened : https://issues.dlang.org/show_bug.cgi?id=7417

*** This issue has been marked as a duplicate of issue 7417 ***

--
March 21, 2020
https://issues.dlang.org/show_bug.cgi?id=19495

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|b2.temp@gmx.com             |

--