VC++11 implements conversion from no-capture lambdas to function pointers, in accordance to the C++ specification. As an extension, it allows the conversion to use any calling convention, so that we can easily use lambdas with existing Win32 APIs.However, there seem to be some problems with this. Nested lambdas do not appear to pick the calling convention correctly. They pick __cdecl even when I need __stdcall. My motivating example looked something like this:CreateThread(nullptr, 0, [] (void*) -> DWORD { CreateThread(nullptr, 0, [] (void*) -> DWORD { return 0; }, nullptr, 0, nullptr); return 0;}, nullptr, 0, nullptr);The outer lambda converted correctly. The inner one did not.
Visual Studio/Team Foundation Server/.NET Framework Tooling version
Steps to reproduce
Product Language
Operating System
Operating System Language
Actual results
Expected results
Please wait...