Should `pragma(inline, expression)` be allowed ?
Basile B.
b2.temp at gmx.com
Tue Oct 20 08:52:07 UTC 2020
On Tuesday, 20 October 2020 at 05:18:50 UTC, H. S. Teoh wrote:
> On Tue, Oct 20, 2020 at 01:54:38AM +0000, Basile B. via
> Digitalmars-d wrote:
>> On Tuesday, 20 October 2020 at 01:32:23 UTC, James Blachly
>> wrote:
>> > This would solve a problem I had whereby we had several
>> > compile time backends available and wanted to do
>> >
>> > version(A || B)
>>
>> I would not bet too much on this one if I were you...
>
> This has cropped up countless times over the years, and so far,
> the answer has been an adamant No. I'm not holding my breath on
> this one.
>
> If you *really* can't live without ||, use static if instead.
> (Yes, it's uglier, but no, I don't have a better idea.)
>
>
> T
yeah, CTFE on `version()` would be basically like `static if
(ident <op> ident)` and alikes, so `version()` much less
justified because not special anymore.
By the way, to the attention of James, the other day I've found
this nice helper by Simons K:
https://forum.dlang.org/post/tghdaffyugrajmenddav@forum.dlang.org, allowing to use version idents in static if expressions, the easiest way possible.
More information about the Digitalmars-d
mailing list