force_inline etc.

eles via Digitalmars-d digitalmars-d at puremagic.com
Tue Feb 3 05:44:12 PST 2015


On Tuesday, 3 February 2015 at 13:34:23 UTC, Steven Schveighoffer 
wrote:
> On 2/3/15 7:39 AM, Manu via Digitalmars-d wrote:
>> On 3 February 2015 at 01:16, John Colvin via Digitalmars-d

> To be honest, I thought the debate was more about whether force 
> inline should fail to compile if inlining cannot happen, with 
> Walter thinking it should still compile. But maybe I don't 
> remember it well enough.

But this is exactly the difference between force_inline and 
please_inline.

I think the fastest and easiest way to move forward right now on 
the issue is with a pragma instead of attirbutes.

The former is not as disruptive and could be easily re-defined or 
rolled back if too much trouble.

As a personal opinion, I think we (well, generic "we") should be 
a bit a more liberal when it comes to experimenting with pragmas.

I would prefer better parameters for this pragma instead of 
"true" and "false".

Maybe "cold" and "hot" or "warning", "error" (as action to be 
taken by the compiler if the inlining is impossible).

Anyway, I feel that the pragma shall provide a way to cancel 
compilation if the inline clause cannot be satisfied, but for 
those functions that are specifically marked as such (see "error" 
above).



More information about the Digitalmars-d mailing list