News for hackers. Stuff that matters.
Re:Fixing for Loops in Go 1.22 by omoikane on Tuesday September 19, 2023 @04:32PM (#37576102)
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

There are no comments on this comment yet.