I'm not sure if that is entirely true. However, if you take the address of a function, that function needs to exist in memory complete with the function's preamble and cleanup code. It's this preamble and cleanup that's omitted when inlining. And you get a whole load of optimisation possibilites when inlined.
But a modern compiler should still be able to inline the function wherever it's possible to inline it. Consider:
int compare (int a, int b)
{
return a compared to b
}
int main ()
{
a = array of ints
qsort (a, compare); // take address of compare function, thus compare function exists in
// app as a proper function
compare (value1, value2); // there's no reason why this can't be inlined
}
I think the quote should be more explicit about what can't be inlined:
A function that is called via a function pointer can not be inlined.
This is because there is no way to determine at compile time what function to inline at the point of the indirect call (the call via the function pointer). This doesn't mean to say that the function that has been pointed to by a function pointer can't be inlined wherever it is called directly.