Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: