title: Is it possible to find the number/type of the captured variables in a lambda?
body: <p>Is it possible to automatically realize the number of the variables captured by the lambda when accessed by value or by reference? Also is it possible to decipher their types? For example, assume this piece of code:</p>
  
  <pre><code>int a = 47;
  int b = 48;
  long long c = 49;
  auto f1 = [=](){ return a + b; };
  auto f2 = [=](){ return a + b + c; };
  </code></pre>
  
  <p>Is it possible to have a function named <code>count_args</code> that returns <code>2</code> in a line and <code>3</code> in the next line if called like below? </p>
  
  <pre><code>std::cout &lt;&lt; count_args( f1 ) &lt;&lt; "\n" &lt;&lt; count_args( f2 );
  </code></pre>