This code int main(){ int i = 0; [i]{ [&]{ int j = i; }; };}triggers the following error:error C2440: '<function-style-cast>' : cannot convert from 'const int' to '`anonymous-namespace'::<lambda1>' No constructor could take the source type, or constructor overload resolution was ambiguousThe following changes make the code compile as expected:- mark the outer lambda 'mutable'- capture 'i' by reference in the outer lambda- remove the 'int j = i;' in the inner lambda- capture everything by value in the inner lambdaPresumably just capturing 'i' by value in the inner lambda would work too, but I can't test that because of https://connect.microsoft.com/VisualStudio/feedback/details/725134 not being fixed in VS11 Beta. This bug may be related to the aforementioned one, as inner lambdas seem to search the outer function block scope, and not the lambda block scope for captures.
Visual Studio/Team Foundation Server/.NET Framework Tooling version
Steps to reproduce
Product Language
Operating System
Operating System Language
Actual results
Expected results