DIP56 - inlining

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Tue Feb 3 18:52:06 PST 2015


On 2/3/15 6:44 PM, Mike wrote:
> On Wednesday, 4 February 2015 at 00:39:05 UTC, Dicebot wrote:
>>>
>>> pragma(inline, true);  // enable -inline compiler flag
>>> pragma(inline, false); // disable -inline compiler flag
>>> pragma(inline);        // use whatever is passed in on the command line
>>>
>>> ...as that is really the intent of DIP56 as confirmed by Walter.
>>
>> No this is definitely not what I wanted.
>
> This is not what I want either.  I find @always_inline and @never_inline
> attributes with compile-time enforcement *far* more useful.
>
> But DIP56 was not originally intended to address that need, and it's a
> shame it was worded as if it was.  pragma(inline, true) is not "always
> inline" and pragma(inline, false) is not "never inline".
>
> Implementing DIP56 as it was originally intended (or more intuitively as
> a way to add compiler flags to part of a file) would not prevent the
> addition of future features to enable inlining enforcement.
>
> But now we're compromising to mediocrity where noone really wins.

Nobody really loses, either. (I'll note that gcc has several mechanisms 
for enabling/disabling inlining, all of which issue a warning at the most.)

The question is, can you get work done with the currently proposed 
semantics? If so, let's commit to this and move on.


Andrei



More information about the Digitalmars-d mailing list