When a function takes an argument by value, it can usually modify it. However, this does not seem to be the case with lambdas. Why?
int main()
{
int x = 0;
auto lambda = [x] { x = 1; }; // error: assignment of read-only variable ‘x’
return 0;
}
Herb Sutter answered the question here as follow;
Note: That is a proposal paper to change the feature.