title: Can a lambda expression be passed as function pointer?
body: <p>I am trying to pass a lambda expression to a function that takes a function pointer, is this even possible?</p>
  
  <p>Here is some sample code, I'm using VS2010:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  void func(int i){cout &lt;&lt; "I'V BEEN CALLED: " &lt;&lt; i &lt;&lt;endl;}
  
  void fptrfunc(void (*fptr)(int i), int j){fptr(j);}
  
  int main(){
      fptrfunc(func,10); //this is ok
      fptrfunc([](int i){cout &lt;&lt; "LAMBDA CALL " &lt;&lt; i &lt;&lt; endl; }, 20); //DOES NOT COMPILE
      return 0;
  }
  </code></pre>