Best way to add templated "intrinsic" functions?

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Tue Jan 5 19:51:54 UTC 2021


On Tuesday, 5 January 2021 at 17:00:32 UTC, kinke wrote:
> On Sunday, 3 January 2021 at 16:54:57 UTC, Ola Fosheim Grøstad 
> wrote:
>> Is there a better way than adding the functions to object.d in 
>> the d-runtime and mark them as "pragma(inline,true"?
>
> That's how I would do it, and I don't think it's too bad.
>
> Adding to object.d is in line with other to-template-lowerings; 
> one-liners etc. are probably fine to add directly, more complex 
> functions can be imported and aliased in object.d. [I think 
> object.d needs to be split up to a little library or package at 
> some point...]

Ok, so if they are marked as always-inline then they won't be 
generated for linking even though they are present in object.d? 
Or do I have to mark them in a special way to avoid 
library-code-gen?



More information about the digitalmars-d-ldc mailing list