DIP56 Provide pragma to control function inlining
Manu
turkeyman at gmail.com
Mon Feb 24 08:44:29 PST 2014
On 23 February 2014 22:55, Walter Bright <newshound2 at digitalmars.com> wrote:
> On 2/23/2014 4:53 AM, ponce wrote:
>
>> On Sunday, 23 February 2014 at 12:07:40 UTC, Walter Bright wrote:
>>
>>> http://wiki.dlang.org/DIP56
>>>
>>> Manu has needed always inlining, and I've needed never inlining. This DIP
>>> proposes a simple solution.
>>>
>>
>> This is great. I bet this will be useful.
>>
>> I tend to prefer force-inline/force-not-inline at call site, but realized
>> the
>> proposal will let me do it:
>>
>> void myFun(bool inlined)(int arg)
>> {
>> static if (inlined)
>> pragma(inline, true);
>> else
>> pragma(inline, false);
>> }
>>
>> Then inlining can be entirely explicit :)
>>
>
> Or better:
>
> void myFun(bool inlined)(int arg)
> {
> pragma(inline, inlined);
> }
>
> :-)
>
Really? I think you're just trying to be different for the sake of being
different :P
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20140225/ce050d87/attachment-0001.html>
More information about the Digitalmars-d
mailing list