title: what is the type signature of a c++11/1y lambda function?
body: <p>I was wondering if there is a standard way to get the type signature (i.e. the return type and the types) of its parameters of any given lambda? </p>
  
  <p>The reason I ask is that I've always wondered what exactly is the type <code>auto</code> in the declaration like <code>auto l =[](int x,int y)-&gt;int{return x+y;}</code>. In other use cases of <code>auto</code>, it's a convenience and shorter alternative for a longer type name. But for lambdas, is there even an alternative way to declare the lambda variable?</p>
  
  <p>My understanding is that a standard lambda is nothing more than a function object, and it is its own type. So, even if two lambdas have the same return type and parameter types, they are still two different, unrelated classes/functors. But this there a way to capture the fact that they are the same in terms of type signature?</p>
  
  <p>I think the type signature I am looking for can be something like a <code>std::function&lt;&gt;</code> object of the correct types.</p>
  
  <p>A more useful/involved question is, if it's possible to extract the type signature, this is possible to write a general wrapper function to convert any lambda function to a <code>std::function</code> object of the same type signature.</p>