title: Will C++0x support __stdcall or extern "C" capture-nothing lambdas?
body: <p>Yesterday I was thinking about whether it would be possible to use the convenience of C++0x lambda functions to write callbacks for Windows API functions.</p>
  
  <p>For example, what if I wanted to use a lambda as an <a href="http://msdn.microsoft.com/en-us/library/ms633493.aspx" rel="noreferrer"><code>EnumChildProc</code></a> with <a href="http://msdn.microsoft.com/en-us/library/ms633494.aspx" rel="noreferrer"><code>EnumChildWindows</code></a>? Something like:</p>
  
  <pre><code>EnumChildWindows(hTrayWnd, CALLBACK [](HWND hWnd, LPARAM lParam) {
          // ...
          return static_cast&lt;BOOL&gt;(TRUE); // continue enumerating
      }, reinterpret_cast&lt;LPARAM&gt;(&amp;myData));
  </code></pre>
  
  <p>Another use would be to write <code>extern "C"</code> callbacks for C routines. E.g.:</p>
  
  <pre><code>my_class *pRes = static_cast&lt;my_class*&gt;(bsearch(&amp;key, myClassObjectsArr, myClassObjectsArr_size, sizeof(my_class), extern "C" [](const void *pV1, const void *pV2) {
          const my_class&amp; o1 = *static_cast&lt;const my_class*&gt;(pV1);
          const my_class&amp; o2 = *static_cast&lt;const my_class*&gt;(pV2);
  
          int res;
          // ...
          return res;
      }));
  </code></pre>
  
  <p>Is this possible?</p>
  
  <p>I can understand that lambdas that capture variables will never be compatible with C, but it at least seems possible to me that <em>capture-nothing</em> lambdas can be compatible.</p>