title: Assign a pointer to a lambda function countaining variables passed by reference
body: <p>I would like to assign a pointer to a lambda function, in which the lambda function is taking variables passed by reference, not by value.</p>
  <pre><code>int main() {
      // what I can do, but not quite what I want
      auto funcy = [](const double i ) {
          std:: cout &lt;&lt; &quot;this is i: &quot; &lt;&lt; i &lt;&lt; std::endl;
      };
  
      void(*lptr)(double); // OK
      lptr = funcy;
      lptr(1);
  
      // TODO: make a variable that points to this lambda work
      auto funcy2 = [](const double &amp;i ) {
          std:: cout &lt;&lt; &quot;this is i: &quot; &lt;&lt; i &lt;&lt; std::endl;
      };
  
      void(*lptr2)(double *);  // BROKE
      lptr2 = funcy2;
      lptr2(1);
  
      return 0;
  }
  
  </code></pre>
  <p>Is it possible to do this?</p>
  <p>Thanks for your time.</p>
  <p>Edit: This post is different from <a href="https://stackoverflow.com/questions/28746744/passing-capturing-lambda-as-function-pointer">Passing capturing lambda as function pointer</a> because I have no idea what that one is saying.</p>