title: C++ can compilers inline a function pointer?
body: <p>Suppose I've got a function <code>functionProxy</code> that takes a generic parameter <code>function</code> and call its <code>operator()</code>:</p>
  
  <pre><code>template&lt; typename Function &gt; void functionProxy( Function function ) {
      function();
  }
  </code></pre>
  
  <hr>
  
  <p>The object passed to it may be:</p>
  
  <ul>
  <li><p>a functor:</p>
  
  <pre><code>struct Functor {
      void operator()() const {
          std::cout &lt;&lt; "functor!" &lt;&lt; std::endl;
      }
  };
  </code></pre></li>
  <li><p>a function:</p>
  
  <pre><code>void function( ) {
      std::cout &lt;&lt; "function!" &lt;&lt; std::endl;
  }
  </code></pre></li>
  <li><p>a (C++0x) lambda function:</p>
  
  <pre><code>[](){ std::cout &lt;&lt; "lambda!" &lt;&lt; std::endl; }
  </code></pre></li>
  </ul>
  
  <hr>
  
  <pre><code>int main( )
  {
      functionProxy( Functor() );
      functionProxy( function );
      functionProxy( [](){ std::cout &lt;&lt; "lambda!" &lt;&lt; std::endl; } );
      return 0;
  }
  </code></pre>
  
  <hr>
  
  <p>Will the compiler be able to inline <code>function</code> within <code>functionProxy</code> in all the above cases?</p>