I have compiled this using Visual Studio 2010 compiler and it has compiler error issues on nested lambda capturing the variables captured already by the first lambda:
This is a known limitation of the Visual Studio 2010 C++ compiler. Here is the connect issue tracking it
It's currently marked as fixed in the next version