I used to think that the compiler decides whether to inline a function or not at compile time.
But then I found this code example in "Effective C++":
inline void f() {} // assume compilers are willing to inline calls to f
void (*pf)() = f; // pf points to f
f(); // this call will be inlined, because it's a "normal" call
pf(); // this call probably won't be, because it's through a function pointer
Now I'm confused, does that mean the decision whether to inline a function or not is done at run time, depending on how you use that function?