Header-Only Library - pragma(root)

Stefan Koch uplink.coder at googlemail.com
Sun Jun 14 13:09:44 UTC 2020


On Sunday, 14 June 2020 at 10:35:51 UTC, Stefan Koch wrote:
> On Sunday, 14 June 2020 at 10:24:33 UTC, Walter Bright wrote:
>> On 6/14/2020 2:52 AM, Mathias LANG wrote:
>>> https://github.com/dlang/dmd/pull/7099
>>> It's essentially putting rdmd in the compiler because rdmd 
>>> was considered too slow.
>>
>> Thank you. I see I was involved in the discussion.
>>
>> The issue is then should the implementer of the module decide 
>> if it is header-only (i.e. pragma(root)) or the caller (-i).
>>
>> It would probably be better as the implementer, as a 
>> header-only library has to be designed for it. It also means 
>> the user needn't need to set the switches, he can just compile.
>
> I agree with everything except for the name.

I take it back.
I thought this was per_symbol rather than per_module.

I would be on-board with doing this per symbol.
And infact I am implementing it right now.
To see where the challenges are.


More information about the Digitalmars-d mailing list