TypeFunction example creatiing a conversion matrix

Adam D. Ruppe destructionator at gmail.com
Thu Oct 1 21:57:13 UTC 2020


On Thursday, 1 October 2020 at 21:34:54 UTC, Walter Bright wrote:
> I suggest an improvement to it where it will return false if 
> the only use of a template instantiation is in CTFE. If that is 
> unimplementable (the separate compilation model may make it 
> impractical), a fallback position is to have a pragma or some 
> other mechanism that says "don't generate code for this 
> function".

Yes! Stefan actually already wrote this too

https://github.com/dlang/dmd/pull/11007

just a few minor tweaks and it can work to help out. The 
`assert(__ctfe)` pattern is already used in some code in the wild.


More information about the Digitalmars-d mailing list