Schrodinger's CTFE
Steven Schveighoffer
schveiguy at gmail.com
Thu Jul 16 21:19:47 UTC 2020
On 7/16/20 4:51 PM, Andrei Alexandrescu wrote:
> On 7/16/20 12:04 PM, Steven Schveighoffer wrote:
>> On 7/16/20 2:32 AM, Andrei Alexandrescu wrote:
>>> I got good news for you then: https://github.com/dlang/dmd/pull/11236
>>
>> That is good news, and will help here!
>>
>> This should suffice:
>>
>> @property pure @safe nothrow bool reachable() {
>> pragma(inline, true);
>> return true;
>> }
>>
>> Though I don't know if this is something we should include in Phobos?
>
> Perhaps in std.benchmark. This function is loosely related to
> DoNotOptimize in https://github.com/google/benchmark.
Possibly. But this is not exactly for benchmarking, it's for making
something compile when it normally doesn't.
I don't know if it's related to DoNotOptimize. In fact, we want it to be
optimized away completely, and be replaced with `true`.
I was thinking std.meta, since it's a tool for compile-time branches/loops.
-Steve
More information about the Digitalmars-d
mailing list