moving inline keyword from callee to caller
Posted Feb 23, 2007 14:03 UTC (Fri) by
samtherecordman (guest, #43207)
In reply to:
Drawing the line on inline by roc
Parent article:
Drawing the line on inline
In the case where you want to a function to be inline in some cases and not others what about:
int small_function(int val)
{
return val+1;
}
void main()
{
int i = 0;
for(i = 0; i < 10000; i++)
{
small_function() __inline__
}
}
This would support selective inlining, and also helps the programmer who is new to the code visualize what is going on - you don't need to see the definiton of small_function() to see that the function will be inlined.
(
Log in to post comments)