title: Named C++ lambdas for profiling and debugging
body: <p>We use quite a lot of C++11 lambdas in our code, but found that it leads to difficulties with profiling and debugging tools. For instance the MSVC profiler will show lambdas as:</p>
  
  <pre><code>`anonymous namespace'::&lt;lambda0&gt;::operator()(void)const     
  `anonymous namespace'::&lt;lambda1&gt;::operator()(double,double)const    
  ...
  </code></pre>
  
  <p>This does not really help to identify the lambda at first glance in a stacktrace or profiler summary. </p>
  
  <p>Is there any way to give the lambda a name for debugging purposes (it should be the mangled name of the scope in which it is defined, IMHO)? I am okay with platform specific solutions (<code>#pragma</code>?) and hacks.</p>
  
  <p>Special namespaces could work but it would require jumping to some hoops from our regular namespace.</p>