DIP56 Provide pragma to control function inlining

francesco cattoglio francesco.cattoglio at gmail.com
Tue Feb 25 00:28:40 PST 2014


On Monday, 24 February 2014 at 22:09:49 UTC, Jerry wrote:
> Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org> writes:
>
>> On 2/23/14, 8:26 PM, Vladimir Panteleev wrote:
>>> Thus, I think there should be "try to inline" (same as 
>>> -inline) and
>>> "always inline" (failure stops compilation).
>>
>> Sounds fair enough.
>
> pragma(inline, false);
> pragma(inline, true);
> pragma(inline, force);  // inline or die
>
> How is that?

Personally I like it. Perhaps you forgot
pragma(inline, never);  // don't inline or die
but I honestly have no idea if this would actually be useful.

Anyway, I'm really fine if there will be no way to force inline. 
But if we can't guarantee that inlining actually happens, please 
change the pragma name.


More information about the Digitalmars-d mailing list