DIP56 Provide pragma to control function inlining

Walter Bright newshound2 at digitalmars.com
Sun Feb 23 04:51:01 PST 2014


On 2/23/2014 4:38 AM, Dmitry Olshansky wrote:
> Why pragma?

Answered in another post.


> Also how exactly it is supposed to work:

T func(args)
{
     ...
     pragma(inline, true);
     ...
}


> How to return to normal state then?

Not necessary when it's inside a function.


> I'd strongly favor introducing a compiler-hint family of UDAs and
> force_inline/force_notinline as first among many.

I don't see an advantage of that over pragma. It also seems like something that 
should be inside a function, not outside. (After all, a function with no body 
cannot be inlined.)



More information about the Digitalmars-d mailing list