Hacker News new | past | comments | ask | show | jobs | submit login

By having the compiler generate the equivalent of [&args...], where args are names of arguments in the parent function's header.



why [&args...] and not [args...] ? do you really want to capture by reference when you're setting a lambda as a callback ? (likewise in the other direction - tons of arguments for every default, already debated ad nauseam)


And why specifically args instead of all locals?


You mean like this? https://godbolt.org/z/jvG3hY




Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: