Validity of cast(void*)size_t.max

Stefan Koch uplink.coder at googlemail.com
Mon Mar 5 18:08:12 UTC 2018


On Monday, 5 March 2018 at 18:04:20 UTC, Nordlöw wrote:
> On Monday, 5 March 2018 at 16:07:49 UTC, Steven Schveighoffer 
> wrote:
>> No, I mean you call holeKey at *runtime*. Inlined, it's just 
>> returning a constant, so it should reduce to a constant.
>
> A compile-time constant visible to the optimizer?

Yes indeed. For gdc and ldc the optimisation is guranteed and I 
am quite dmd can do this as well. As long as you don't have too 
many statements.


More information about the Digitalmars-d-learn mailing list