3 ms·
By having the compiler generate the equivalent of [&args...], where args are names of arguments in the parent function's header.
by TeMPOraL 6y ago
By having the compiler generate the equivalent of [&args...], where args are names of arguments in the parent function's header.
- jcelerier 6y agowhy [&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)
- gpderetta 6y agoAnd why specifically args instead of all locals?
- nwallin 6y agoYou mean like this? https://godbolt.org/z/jvG3hY https://godbolt.org/z/jvG3hY