Best way to add templated "intrinsic" functions?

Guillaume Piolat first.last at gmail.com
Mon Jan 4 21:52:03 UTC 2021


On Sunday, 3 January 2021 at 16:54:57 UTC, Ola Fosheim Grøstad 
wrote:
> I want to add templated functions that always should be 
> inlined, basically templated functions that have special syntax 
> added for it in the parser.
>
> What is the best way to go about this? Is there a better way 
> than adding the functions to object.d in the d-runtime and mark 
> them as "pragma(inline,true"?
>
> Maybe not a LDC specific question.

pragma(inline,true) probably.

If it's worth inlining and you are using LDC, you can have high 
confidence it will be inlined. There is a bit too much of "forced 
inlined" in this world, often without any measurements.


More information about the digitalmars-d-ldc mailing list