title: How I can pass lambda expression to c++ template as parameter
body: <p>I have a template that accepts a function as an argument. </p>
  
  <p>When I try to pass a lambda expression it does not compile.</p>
  
  <pre><code>typedef int (*func)(int a);
  template &lt;func foo&gt;
  int function(int a)
  {
      foo(a);
  }
  
  int test(int a)
  {
      return a;
  }
  
  int main()
  {
      function&lt;test&gt;(1);   // ---&gt; this is ok
  
      auto lambda = [](int a) -&gt; int { return a; };
      function&lt;lambda&gt;(1); // ---&gt; this is wrong, why?
  
      return 0;
  }
  </code></pre>
  
  <p>What I am missing?</p>