Код: Выделить всё
int x;
int main() {
[&x](int n){x = n;}; // 'x' cannot be captured...
return 0;
}
Код: Выделить всё
static int s = 0;
[](int n){s = n;};
Подробнее здесь: https://stackoverflow.com/questions/244 ... -variables
Код: Выделить всё
int x;
int main() {
[&x](int n){x = n;}; // 'x' cannot be captured...
return 0;
}
Код: Выделить всё
static int s = 0;
[](int n){s = n;};