force inline/not-inline

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 31 05:06:32 PDT 2015


On 7/30/15 4:37 PM, Jonathan M Davis wrote:
> On Thursday, 30 July 2015 at 18:41:51 UTC, Steven Schveighoffer wrote:
>> OK, that is what I first thought. Then I thought it meant that for
>> that function, it works as if -inline was passed on the command line
>> (i.e. try to inline if possible, if not, don't worry about it). So you
>> are saying the first interpretation is correct?
>>
>> That means pragma(inline) is essentially useless.
>
> Well, if pragmas work with : like attributes (I don't know if they do),
> then pragma(inline) would be a way to undo a pragma(inline, true) or
> pragma(inline, false) on specific functions, similar to how many folks
> want !final or final(false) after using final:, but if : doesn't work
> with pragmas, then yeah, it's totally useless.

Without knowing the rules what does this do:

pragma(inline):
int foo()
{
    return 1;
}

If anyone reads this and says he intuitively thinks "oh, that will mean 
you have to pass -inline on the command line to get it inlined," I think 
he is not being truthful.

-Steve


More information about the Digitalmars-d mailing list