title: Is it possible to have a function(-name) as a template parameter in C++?
body: <p>I don't want function pointer overhead, I just want the same code for two different functions with the same signature:</p>
  
  <pre><code>void f(int x);
  void g(int x);
  
  ...
  
  template&lt;typename F&gt;
  void do_work()
  {
    int v = calculate();
    F(v);
  }
  
  ...
  
  do_work&lt;f&gt;();
  do_work&lt;g&gt;();
  </code></pre>
  
  <p>Is this possible?</p>
  
  <hr>
  
  <p>To clear up possible confusion: With "template parameter" I mean <em>the parameter/argument to the template</em> and <strong><em>not</strong> a function parameter whose type is templated</em>.</p>