title: Using function template as template template parameter in C++
body: <p>Suppose I have a function with a template template parameter, like this:</p>
  
  <pre><code>template &lt;template &lt;class T&gt; class F, typename P&gt;
  void applyFunction(int param)
  {
      F&lt;P&gt; fn;
      fn(param);
  }
  </code></pre>
  
  <p>The above can take an arbitrary class template for a Functor and apply it. So for example if I defined:</p>
  
  <pre><code>template&lt;typename T&gt;
  struct SomeFunctor
  {
      void operator()(int param)
      {
          T::doStuff(param);
      }
  };
  </code></pre>
  
  <p>Then I could make the following call:</p>
  
  <pre><code>applyFunction&lt;SomeFunctor, MyClass&gt;(0);
  </code></pre>
  
  <p>But what I'd really like to do is to be able to pass function templates (rather than just class templates that define functors). So if I had something like this:</p>
  
  <pre><code>template&lt;typename T&gt;
  void someFunction(int param)
  {
      T::doStuff(param);
  }
  </code></pre>
  
  <p>Ideally I'd be able to do something like this:</p>
  
  <pre><code>applyFunction&lt;someFunction, MyClass&gt;(0);
  </code></pre>
  
  <p>Unfortunately as it stands this is not legal C++. Is there a way to do this that I'm missing? In other words pass a function template rather than a class template as a template template parameter? Conceptually I don't see why it shouldn't be possible.</p>