3 ms·
This bug appears to be because Go captures loop variables by reference, but C++ captures are by copy[1] unless user explicitly asked for reference (`&variable`)
by omoikane 3y ago
This bug appears to be because Go captures loop variables by reference, but C++ captures are by copy[1] unless user explicitly asked for reference (`&variable`). It seems like the same bug would be visually more obvious in C++.
[1] https://eel.is/c++draft/expr.prim.lambda.capture#10 https://eel.is/c++draft/expr.prim.lambda.capture#10