force inline/not-inline

David Nadlinger via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 28 15:12:19 PDT 2015


On Tuesday, 28 July 2015 at 21:29:45 UTC, Steven Schveighoffer 
wrote:
> On 7/28/15 5:28 PM, Steven Schveighoffer wrote:
>> On 7/28/15 5:24 PM, David Nadlinger wrote:
>>> On Tuesday, 28 July 2015 at 15:56:52 UTC, Jonathan M Davis 
>>> wrote:
>>>> It[Accepting Booleans]'s far more flexible in generic code.
>>>
>>> It's the other way round. pragma(inline) has currently 
>>> *three* behaviors:
>>>
>>> pragma(inline);
>>> pragma(inline, true);
>>> pragma(inline, false);
>>>
>>> There is no way to represent those as a single boolean.
>>
>> Ugh. And pragma(inline) doesn't mean what you would think it 
>> means. This
>> is not a very good API for it, it's going to confuse everyone.
>
> Er.. nevermind. I misread the docs. I think.

I do think it is terribly confusing. pragma(inline) does not 
cause any inlining by itself at all. It just means to let the 
compiler do what it normally does (i.e. try to inline if -inline 
is specified).

  — David



More information about the Digitalmars-d mailing list