title: Is there a std::function type or similar for lambda with auto parameter?
body: <p>When I assign a lambda to an explicitly typed variable (for example when it is recursive, to capture the function in itself), I use <code>std::function</code>.</p>
  
  <p>Consider this silly "bit counting" function as an example:</p>
  
  <pre><code>std::function&lt;int(int)&gt; f;
  f = [&amp;f](int x){ return x ? f(x/2)+1 : 0; };
  </code></pre>
  
  <p>What about the case when we use an auto parameter to generalize <code>x</code>, as introduced in C++14 generic lambda?</p>
  
  <pre><code>std::function&lt;int(???)&gt; f;
  f = [&amp;f](auto x){ return x ? f(x/2)+1 : 0; };
  </code></pre>
  
  <p>Obviously, I can't place <code>auto</code> in the <code>function</code> type parameters.</p>
  
  <p>Is there a possibility to define a functor class generically enough to cover the exact case above, but still using lambda for the function definition?</p>
  
  <p>(Don't over-generalize this, only accept a single auto parameter and hard-code the return value.) The use case would be for the scenario like above: capturing the function in itself by reference for recursive calls.</p>