title: Is inlining done at compile time or run-time?
body: <p>I used to think that the compiler decides whether to inline a function or not at compile time.</p>
  
  <p>But then I found this code example in "Effective C++":</p>
  
  <pre><code>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
  </code></pre>
  
  <p>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?</p>