DIP56 - inlining

Mike via Digitalmars-d digitalmars-d at puremagic.com
Tue Feb 3 18:44:45 PST 2015


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.

Mike


More information about the Digitalmars-d mailing list