version as an expression?

Nick Treleaven nick at geany.org
Mon Sep 12 10:02:48 UTC 2022


On Sunday, 11 September 2022 at 21:38:51 UTC, ryuukk_ wrote:
> On Sunday, 11 September 2022 at 05:38:44 UTC, TheGag96 wrote:
>> On Thursday, 8 September 2022 at 21:15:18 UTC, ryuukk_ wrote:
>>> (snip)
>>
>> Well, for now, there's at least [this 
>> hack](https://forum.dlang.org/post/mailman.2048.1462983185.26339.digitalmars-d@puremagic.com) using a `struct` with a `static` `opDispatch`. I [use it](https://github.com/TheGag96/sm64-port/blob/dlang/src/dsrc/util.d#L16-L20) in [some places](https://github.com/TheGag96/sm64-port/blob/dlang/src/dsrc/config.d#L16-L27) in a project of mine.
>
> It doesn't work with alias
```d
import std.traits;
alias A = Select!(isVersion("Windows"), WinType, PosixType);
```


More information about the Digitalmars-d mailing list