This was a change that did not make it to C ++ 11, but C ++ 14, we can see the rationale for N3610 :
++ 11 lambdas . ++ 11 NB , - JP9 CD1, - FI8 FCD. FI8 Core , , , . , iostreams ( stringstreams) unique_ptrs . Evolution -2012 , " ++ 11". , ;
N3648:
init-capture , init-capture . , . form "auto init-capture;", , (.. init-capture) . [ . init "x = std:: move (x)"; "x" . --end note ] init. lambda-expression lambda-declarator , init-capture , -. [:
int x = 4;
auto y = [&r = x, x = x+1]()->int {
r += 2;
return x+2;
}(); // Updates ::x to 6, and initializes y to 7.
- ]
++ 14 N3936, .