title: How to get the "raw" ptr of a lambda *capture* function
body: <p>I want to make a C++ assembly hooking using lambda captures but for this i need to get the pointer of a lambda <strong>capture</strong> function.</p>
  <p>something like this:</p>
  <pre class="lang-cpp prettyprint-override"><code>int val0 = 42;
  auto lambdaCap = new auto([&amp;]() -&gt; int { return val0++; });
  uint64_t pLambdaFn = static_cast&lt;uint64_t&gt;(&amp;decltype(*lambdaCap)::operator()); // need this
  </code></pre>
  <p>I understand than a lambda function capture seems like an instance of class with a functor, but i want get the static address of lambda::operator().  In memory &quot;lambdaCap&quot; is just a ptr to the variables members used in the lambda.</p>
  <p>Thanks</p>