Closure und verschachtelte Lambdas in C ++ 0x
Wie erfasse ich mit C ++ 0x eine Variable, wenn ich ein Lambda innerhalb eines Lambdas habe? Beispielsweise
std::vector<int> c1;
int v = 10; <--- I want to capture this variable
std::for_each(
c1.begin(),
c1.end(),
[v](int num) <--- This is fine...
{
std::vector<int> c2;
std::for_each(
c2.begin(),
c2.end(),
[v](int num) <--- error on this line, how do I recapture v?
{
// Do something
});
});