inlining or not inlining...

spir denis.spir at gmail.com
Sat Feb 12 02:47:31 PST 2011


On 02/12/2011 10:46 AM, Christopher Nicholson-Sauls wrote:
>>
>> All of this is hardly related to the simple feature I initially asked for:
>>
>>      string escString (string s) @tellmeifnotinlined {
>>          s2 = s.replace("\n","\\n");
>>          s2 = s.replace("\t","\\t");
>>              return s2;
>>          }
>>      void show (X x) {
>>          // ... use escString ...
>>          }
>> ==>
>>      Warning: function 'escString' in module 'foo' (line 123) was not
>> inlined.
>>      (or else it was actually inlined)
>>
>> Which (I guess) is not that a big deal since the compiler needs to
>> decide anyway. I just wish to be informed of the result of the decision
>> procedure, only in case of 'no'.
>>
>> Denis
>
> I could really go for that, myself.  Occasionally I've wanted such a
> beasty.  I really do think it makes more sense as a pragma() than an
> attribute unto itself, though.

Agreed, since it's not a language feature properly speaking. Anyway...

Denis
-- 
_________________
vita es estrany
spir.wikidot.com



More information about the Digitalmars-d mailing list